Integrator filter with delayless feedback path

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

neotec wrote:
aciddose wrote:of course, that should bother anyone. that's because the output phase isn't correct using this method.
The phase is correct. If it wouldn't be, the resonance peaks wouldn't occur perfectly at 'fc' (for all 'fc'). I've plotted the 4th order ladder filter, -180° at fc, -90° at fc*0.4 ... works as expected (compared to a bode plot of a 'perfect' 4th order lowpass filter).
He's talking about a different thing: output phase (over all the different frequencies). Only the feedback paths will have effect on the system poles, so your resonant frequencies and their Qs will stay the same whatever you do with (non-feedback) inputs and outputs (note that in general you can add multiple inputs to a filter just like you can add multiple outputs).

Now depending on what inputs you feed to various nodes, and what outputs you take from other nodes you get different zeroes. The zeroes are what's different between a low/high/band pass or notch or peaking or shelving or whatever else for that matter.

Now, if we take the input and subtract a low-pass filtered version of the same, we only get proper high-pass in the first-order low-pass case. With 2nd (and higher) order filters the low-pass filter will cause more phase shift, so the substraction no longer makes sense (not in time domain anyway). It is simple to see this in terms of transfer functions:

Code: Select all


input - lowpass for second order

          1            s^2 + s/Q + 1           1
 1 - -------------  = --------------- - --------------
     s^2 + s/Q + 1     s^2 + s/Q + 1     s^2 + s/Q + 1


    s^2 + s/Q
 = -------------
   s^2 + s/Q + 1

Since highpass has a transfer function

       s^2
 ---------------
  s^2 + s/Q + 1

We see that in 2nd order case the trick works properly only for infinite Q (in which case s/Q has limit at 0). This agrees with the observation that our 2nd order SVF has high-pass output where we've already summed not just the low-pass but also the band-pass feedback (which is 0 for infinite Q, duh).

For higher orders stuff just gets worse.

There are really only two proper ways. One way is to a low-pass and swap all the one-pole lowpass sections with one-pole high-pass sections (and make sure you get the signs right). That should mirror the frequencies (eg low frequencies become high and high become low in the transfer function).

The other way is to actually figure out what the transfer function zeros at various nodes are (the poles are the same everywhere) and then form a weighted combination of outputs from said nodes to get whatever zeroes you really want. Since the zeroes depend on your input point, you can alternatively figure out what zeroes you will get at your chosen output for various input nodes, and form the zeroes as weighted combination of those.

Just remember that you MUST do all the calculations on the transfer functions (rather than weights or coefficients directly) because otherwise the phase-shift will make it won't work.

Note that in general there is no reason to believe that an arbitrary set of ouput (or input) nodes can realize an arbitrary set of responses without any singularities and the amount of math you need to do to figure out the right combinations depends pretty heavily on where you pick your outputs (or inputs).

You could try searching for "observer canonical" (for zeroes by combined outputs) and "controller canonical" (for zeroes by combined inputs) for some stuff that might (or might not) be helpful in figuring this out. Basically you should find the direct-form equivalents of analog filter design, but end up with other useful discussion about observability/controllability. :)

Post

@mystran : Thanks, really. I never though about looking at the transfer functions ... now it makes sense^^

I think I will have a look at the observer/controller canonical stuff. Strange that I can't seem to solve the overall high pass filter feedback equation. It just 4 one pole cascaded high passes and it works perfectly without resonance ... and crashes on every attempt to implement resonance.

Shouldn't it just work like a low pass using negative feedback and produce the same audible results? (Currently I'm getting a triangle wave like shaped resonance). The phase shift of a 4th order high pass is +180° at fc, which is identical to the low pass with -180° ... I'm somehow clueless ... maybe there's something wrong with my one pole high passes, I'm using this structure:

Code: Select all

in->---(+)-----------------+-> HP
       (-)                 |
        |-<-[integrator]-<-|
which is basically just input-LPF(input). Need to have another look at this when I get back home.


Edit: On the other hand ... when looking at the transfer functions:

Code: Select all

       s
HP = -----
     1 + s

       1  
LP = -----
     1 + s

Closed loop feedback:

    G(s)
-------------
1 + G(s)*H(s)

Then an integrator G(s) = 1/s in a closed feedback loop will generate an LP.
And a differentiator G(s) = s in a closed feedback loop should generate an HP.

I'll try the differentiator method later ... maybe I'll get better results using this.

... or maybe I'm totally wrong with my transfer function mangling^^

... maybe I should study some more DSP stuff ... I feel like discovering basic stuff everybody else knows already right here right now^^
... when time becomes a loop ...
---
Intel i7 3770k @3.5GHz, 16GB RAM, Windows 7 / Ubuntu 16.04, Cubase Artist, Reaktor 6, Superior Drummer 3, M-Audio Audiophile 2496, Akai MPK-249, Roland TD-11KV+

Post

neotec wrote: Then an integrator G(s) = 1/s in a closed feedback loop will generate an LP.
And a differentiator G(s) = s in a closed feedback loop should generate an HP.

I'll try the differentiator method later ... maybe I'll get better results using this.
Well, yeah. I guess you're correct.

Now observe that when you do your bilinear transform the integrator will give you a pole at 1 and zero at -1. The differentiator will give the opposite: pole at -1 and zero at 1.

Have you tried reversing the sign of your bilinear differentiators (or high-passes, which ever you build your filters from).

Also, when you have saturation the differentiator approach is a BAD IDEA because in the integrator case those will damp the generated aliasing, where as in the differentiator case the opposite will be true.

I'd really solve for the zero-positions instead. :P

Post

when using first order stages in series, you can quite easily just take the highpass output for each stage which is then valid, and process the next stage using that as an input rather than the lowpass as input before applying the same at each step.

that results in the proper highpass, bandpass or whatever result is desired.

when you have a more complex system however it's impossible.

the only way to achieve what you want is really to use highpass stages rather than lowpass stages. they are actually fully interchangeable so there shouldn't really be any issue.
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

Actually, a 24dB SVF filter has a slightly different layout. It's called "Leapfrog" design in some books and it's basically a cascade of integrators that feed back into themselves and the stage before. Google images for "Leapfrog filter" and you'll see what I mean :)

Post

Urs wrote:Actually, a 24dB SVF filter has a slightly different layout. It's called "Leapfrog" design in some books and it's basically a cascade of integrators that feed back into themselves and the stage before. Google images for "Leapfrog filter" and you'll see what I mean :)
Which btw. will be difficult to model with zero delay feedback because it's not a single feedback path.

Post

Urs wrote:Google images for "Leapfrog filter" and you'll see what I mean :)
Hey, it comes up with pics of that handheld thing my daughter's using :D

That specific SVF design looks really wicked. Where was that built into, in particular?
Sascha Eversmeier
drummer of The Board
software dev in the studio-speaker biz | former plugin creator [u-he, samplitude & digitalfishphones]

Post

Urs wrote:Actually, a 24dB SVF filter has a slightly different layout. It's called "Leapfrog" design in some books and it's basically a cascade of integrators that feed back into themselves and the stage before. Google images for "Leapfrog filter" and you'll see what I mean :)
"leapfrog" design is indeed very neat. it is derived from rearranging normal solutions of integration with some goals of preserving positive properties of a base structure.

however, i do believe a more generalized n-th order state variable topology can be constructed of just a summator stage followed by n biquad integrators, which only feed back to the summator input(s). with op-amps in mind, every odd number biquad would feed to the non-inverting input, while every even number one would feed to the inverting. the HP output would be the summator output (like in most common topologies TT, KHN etc..), the stage output would be the LP and the BP would probably end up being at the output of the n-th/2 integrator.

resonance controllable gain could be achieved by adding an inverting comparator at the feedback of the n-th/2 integrator.

the ease with this design of course, unlike "leapfrog" would be, that all feedback goes back to the summator and there is no feedback in between integrators, which might ease the dsp implementation. having said that, even with a nice set of improvements for the vanilla prediction for zero delay, it will probably end up being quite the cpu hog for older machines (e.g. 10 y/o).

it might end up lacking the clarity of the "leapfrog", but will still have the common stability for fast component changes of the general state-variable (for a biquad that is).

[this post might not be very useful to the thread...sorry about that if so]

--
linux/win32 framework for plugins and exacutables:
holos.googlecode.com

Post

Urs wrote:
Urs wrote:Actually, a 24dB SVF filter has a slightly different layout. It's called "Leapfrog" design in some books and it's basically a cascade of integrators that feed back into themselves and the stage before. Google images for "Leapfrog filter" and you'll see what I mean :)
Which btw. will be difficult to model with zero delay feedback because it's not a single feedback path.
I remember doing "a cascade of integrators that feed back into themselves and the stage before" using the zero-delay feedback technique (didn't know it's called "leapfrog" design though). Worked out quite nicely. And remember that in the worst (most complicated) case you simply have to solve a system of linear equations.

Regards,
{Z}

Post

lubomir.ivanov wrote:however, i do believe a more generalized n-th order state variable topology can be constructed of just a summator stage followed by n biquad integrators, which only feed back to the summator input(s).
This is referred to as canonical controllable form, IIRC. The question is how to choose the feedback coefficients, because there are way more options than for 12dB, where essentially we have only one parameter. The choice will define the positions of the poles and hence the strength and the shape of the resonance peak.

Regards,
{Z}

Post

Z1202 wrote:
lubomir.ivanov wrote:however, i do believe a more generalized n-th order state variable topology can be constructed of just a summator stage followed by n biquad integrators, which only feed back to the summator input(s).
This is referred to as canonical controllable form, IIRC. The question is how to choose the feedback coefficients, because there are way more options than for 12dB, where essentially we have only one parameter. The choice will define the positions of the poles and hence the strength and the shape of the resonance peak.

Regards,
{Z}
Yep, sounds just like the Linkwitz-Riley crossover I used to implement a 4 pole SVF ... it was described on page three of this thread in some ossom ASCII pseudo DSP block diagram. All integrator outputs feedback into the summator stage using 2*sqrt(2) as feedback factors for 1st and 3rd integrator, 2/q for 2nd and 1 for the 4th. Feedback solving is not a problem, but I still have to compare if cascading 2 12dB SVFs would be faster (CPU wise).
... when time becomes a loop ...
---
Intel i7 3770k @3.5GHz, 16GB RAM, Windows 7 / Ubuntu 16.04, Cubase Artist, Reaktor 6, Superior Drummer 3, M-Audio Audiophile 2496, Akai MPK-249, Roland TD-11KV+

Post

neotec wrote:
Z1202 wrote:
lubomir.ivanov wrote:however, i do believe a more generalized n-th order state variable topology can be constructed of just a summator stage followed by n biquad integrators, which only feed back to the summator input(s).
This is referred to as canonical controllable form, IIRC. The question is how to choose the feedback coefficients, because there are way more options than for 12dB, where essentially we have only one parameter. The choice will define the positions of the poles and hence the strength and the shape of the resonance peak.

Regards,
{Z}
Yep, sounds just like the Linkwitz-Riley crossover I used to implement a 4 pole SVF ... it was described on page three of this thread in some ossom ASCII pseudo DSP block diagram. All integrator outputs feedback into the summator stage using 2*sqrt(2) as feedback factors for 1st and 3rd integrator, 2/q for 2nd and 1 for the 4th. Feedback solving is not a problem, but I still have to compare if cascading 2 12dB SVFs would be faster (CPU wise).
I remember reading somewhere that higher-order direct forms (which the above is also an example of) are having poor precision performance. Although I can easily understand this for digital DFs, not so sure whether the same applies to similar analog structures. So, cascading might happen to be a better choice (although you'll need to perform two divisions, one for each filter). Still, different topologies might (theoretically) offer noticeably different time-varying behavior (fast modulations).

Post

neotec wrote:Since I started doing DSP (somewhere in 2005 or so) I was looking for an analogue sounding resonant lowpass filter. And just before any discussion about 'analogue sounding' starts, I define what I mean: It's not about the filtering itself, it's about the resonance.
Everybody who has listened to any of the great analogue synths from the past should know what I mean.
Well, resonance is (or was) one of the big issues, which can now be nicely solved using delay-free feedback. I don't think that covers all aspects of analog filters though. Has anyone here tried yet to solve the entire filter structure properly, rather than just the feedback path? Perhaps Diva does this already?

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

Post

Richard_Synapse wrote:Perhaps Diva does this already?
Nope, we've been "cheating" at all ends possible. The results in circuit simulation packages are still quite different from the real thing. If you look at Stinchcombe's MS-20 filter study and then at a real MS-20, the resonance looks completely different than his simulations suggest.

Thus there's a lot of stuff going on in electronics that can't be explained by sheer models. You still need ears / tools to compare and match sound.

Post

Urs wrote:
Richard_Synapse wrote:Perhaps Diva does this already?
Nope, we've been "cheating" at all ends possible. The results in circuit simulation packages are still quite different from the real thing. If you look at Stinchcombe's MS-20 filter study and then at a real MS-20, the resonance looks completely different than his simulations suggest.

Thus there's a lot of stuff going on in electronics that can't be explained by sheer models. You still need ears / tools to compare and match sound.
This makes me want to share how I was recently trying to design (well, it works now, though needs some fine tuning) a custom LM13700 based SVF (thought it would be a fun and easy beginner project for a total electronics newbie). So I fire up LTSpice and figure out how to get the circuit working and check that I have sensible gains and currents going around etc.. and everything works perfectly fine in AC and transient simulation.

I then proceed to build the same stuff on breadboard, and it turns out that some of my resistors need to be "fine-tuned" by about an order of magnitude (mostly stupid and obvious newbie mistakes, but that's not really the point) before it actually starts working properly... and by the time I get it working nice on breadboard, (and copy the changes to Spice) it no longer works in Spice...

I eventually did get the breadboard and Spice to agree to a reasonable degree (and probably improved the performance in the process quite a bit), with the largest remaining difference being that cutoff in Spice still seems about half octave off (too low), but that's probably just a sucky OTA model or something.

I do realize there are probably much better circuit simulators than LTSpice, but it was still quite enlightening to troubleshoot the real circuit when Spice was claiming that it should work just fine. :)

Post Reply

Return to “DSP and Plugin Development”