Cheap non-linear zero-delay filters

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

which positive effects?

the code basically just computes the state of the fourth integrator, then computes the others in reverse from that. you can actually re-compute the fourth after the other three again for a slightly different effect.

the f*g powers are the exponential history of the inputs from the other integrators.

you can actually remove quite a lot of expense but having to re-normalize everything adds a ton of extra multiplications. it's not too much more expensive than other methods for similar results in the linear case and the powers can be computed by re-arranging the order to make them serial, but... i don't see the advantage.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post

aciddose wrote:which positive effects?
The positive effects of being able to add "zero delay" and "topology preserving" to my marketing blurbs? :D

But seriously, don't we expect more accurate tuning and a more correct location of the resonant peak relative to the cutoff slope?

the code basically just computes the state of the fourth integrator, then computes the others in reverse from that. you can actually re-compute the fourth after the other three again for a slightly different effect.

the f*g powers are the exponential history of the inputs from the other integrators.

you can actually remove quite a lot of expense but having to re-normalize everything adds a ton of extra multiplications. it's not too much more expensive than other methods for similar results in the linear case and the powers can be computed by re-arranging the order to make them serial, but... i don't see the advantage.
Only empirical results matter to me. I'll let you know what my ears and analyzers tell me.

Post

AdmiralQuality wrote: But seriously, don't we expect more accurate tuning and a more correct location of the resonant peak relative to the cutoff slope?
nope. once you add any variability to the saturation or modify the feedback tuning goes all out of whack. same thing happens in an analog filter. tuning actually depends upon the level when you're non-linearly shaping the feedback, you already know all this.
Only empirical results matter to me. I'll let you know what my ears and analyzers tell me.
hm, well mine said "Barf".
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post

c'mon guys, we get code that solves a problem that most of us here consider hard, on a silver plate, essentialy free to use, along with rather detailed explanations of how it was derived. definitely nothing to complain about. i say a big thanks to mystran (once again).
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

aciddose wrote:well it is for me. the tanh result sounds horribly muddy. there are many other ways to apply the saturation characteristic to this filter (or any other) and for me the two most important factors are expense and aliasing. aliasing being way more important than expense.
Ideally the filter would become linear where needed, but this could get quite difficult to implement.

Richard
Synapse Audio Software - www.synapse-audio.com

Post

aciddose wrote:
Only empirical results matter to me. I'll let you know what my ears and analyzers tell me.
hm, well mine said "Barf".
If it was that last clip you posted on SoundCloud last night, I agree!

Post

that was a quick test of variations. a lot of wasp fans would disagree too, even though i agree.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post

Richard_Synapse wrote:Ideally the filter would become linear where needed, but this could get quite difficult to implement.
how so? i posted the linear version.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post

aciddose wrote:
Richard_Synapse wrote:Ideally the filter would become linear where needed, but this could get quite difficult to implement.
how so? i posted the linear version.
Yes but I was referring to the nonlinear one, with saturation in all stages. I meant that ideally it would reduce aliasing automatically where needed, by somehow blending towards a more linear version.

Richard
Synapse Audio Software - www.synapse-audio.com

Post

right you mean like how i suggested you interpolate between the result and 1?

or how about replacing the tanh approximation with a simple 1-0.25*abs(x) and scaling the 0.25 part?

these are the easy things to solve. we need to discuss the hard parts.

- general explanation of the integrator and the summation of hysteresis to calculate half the state
- application of this to a generalized template
- use of this template to reproduce the 4-pole, and it's application to 2-pole sallen-key and chamberlain
- technicalities
- various methods of implementation that don't suck
- optimization
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post

AdmiralQuality wrote:I do hope I can understand mystran's code enough to remove the saturators but keep the positive effects. Haven't tried yet... might get to it tonight.
You can travially remove any saturator by setting the corresponding gain t0,...,t1 to 1. Also, you can simply scale any saturator (i.e. change clipping threshold) to 1/a*tanh(a*x) by writing

Code: Select all

double t1 = tanhXdX(a*s[0]);

Post

karrikuh wrote:
AdmiralQuality wrote:I do hope I can understand mystran's code enough to remove the saturators but keep the positive effects. Haven't tried yet... might get to it tonight.
You can travially remove any saturator by setting the corresponding gain t0,...,t1 to 1. Also, you can simply scale any saturator (i.e. change clipping threshold) to 1/a*tanh(a*x) by writing

Code: Select all

double t1 = tanhXdX(a*s[0]);
Yes, I forgot to mention this. That's how I bias my non-linearities since it lets me keep the linear model as-is.

Post

Richard_Synapse wrote: Ideally the filter would become linear where needed, but this could get quite difficult to implement.
Richard
You could in theory - do the non-linearity as an 'instant' feedforward compressor with a slight knee - that would be linear - where you want it to be, but would be expensive. For practical purposes I'd rather use something like tanh(sinh(x)) - 'cause it has a slightly more linear response, and the inter-harmonic relationships vary slightly vs. level. Also as mystran pointed out somewhere in this thread(I think) - you might want set the bias-level of feedback limiter lower than that of the intergrators, and if you follow AdmiralQuality's advice of setting the feedback bias-level at 200% - then you should set the intergrators' bias-level at about 250%. This actually makes sense - from an analog perspective - the feedback-limiter actually 'protects' the integrators in the loop.

Jut my 2cents.

Andrew

Post

Random Note:

If you want to go old-school inductor based filter - google:

DIGITAL IMPLEMENTATION OF MUSICAL DISTORTION
CIRCUITS BY ANALYSIS AND SIMULATION

The Trapezoidal Rule and Backwards Euler formulas are on the very last page.
Also the Trapezoidal Capacitor - seems to match mystan's equation exactly.

Post

Ichad.c wrote: Also as mystran pointed out somewhere in this thread(I think) - you might want set the bias-level of feedback limiter lower than that of the intergrators
If you mean like clip the feedback at lower level, then yeah that can give you cleaner sound without increasing self-oscillation level. It'll make things more subtle though, so if you really want clean sound, I'd just drop the extra non-linearities..

Post Reply

Return to “DSP and Plugin Development”