mutliband-crossover IIR-design with allpass-sum?

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

Robin from www.rs-met.com wrote:yeehaahh - looking forward to it. ...i can already hear the complaints of high CPU-usage when automating crossover-frequencies...
Root solving every sample... au weia.

Post

l0calh05t wrote:Root solving every sample... au weia.
naja, not exactly every sample, but still. i think automation events are somewhat more sparsely scattered. using vst-automation (via setParameter), it would even occur asynchronously (which i consider as kinda weird). however, i rely solely on midi for automation - which is synchronous with the audio-stream but also sparse.

of course, i could apply smoothing - but nah!
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

Robin from www.rs-met.com wrote: naja, not exactly every sample, but still. i think automation events are somewhat more sparsely scattered. using vst-automation (via setParameter), it would even occur asynchronously (which i consider as kinda weird). however, i rely solely on midi for automation - which is synchronous with the audio-stream but also sparse.

of course, i could apply smoothing - but nah!
setParameter can be called asynchronously but you should be synchronizing it with a mutex anyways, which would make it occur blockwise. I don't like using MIDI due to the low precision.

Post

I'm not sure if I'm a bit late to this thread but: If you have a flat crossover, then simply summing the lowpass and highpass responses gives you an allpass. This allpass is the exact same thing you need to use with the "other bands" to compensate. So for example, four way crossover:

Code: Select all

            HP2-process
           /           \
        HP1             Sum2--AP3
       /   \           /         \
      /     LP2-process           \
 input                             output
      \     HP3-process           /
       \   /           \         /
        LP1             Sum3--AP2
           \           /
            LP3-process
where HPx/LPx are flat pair, and APx=HPx+LPx.

So the HP3/LP3 split and resum adds the same phase-shift as the AP3, while the HP2/LP2 split and resum adds the same phase-shift as AP2, and hence the upper and lower branch will sum to flat if the individual HP/LP pairs sum flat.

By linearity, you can also move the AP3/AP2 before the processing, obviously, in case you need individual outputs that'll sum flat without further filtering.

edit:

Futher note that:

Code: Select all

            Ax               Bx                     Ax + Bx
 if  LPx = ----  and  HPx = ----  then LPx + HPx = ---------
            Px               Px                        Px
Last edited by mystran on Fri Feb 19, 2010 7:52 pm, edited 1 time in total.

Post

mystran wrote:[...]
I'm fairly certain that doesn't work.

HP1+LP1 = AP1, ok, but HP1*AP3+LP1*AP2 != AP1, 2 or 3 but some other non-allpass filter results

The resulting sum is not allpass.

Post

mystran wrote:I'm not sure if I'm a bit late to this thread but: If you have a flat crossover, then simply summing the lowpass and highpass responses gives you an allpass.
exactly. that idea just struck me as well. over there in the other thread, i posed the problem of finding the zeros of a parallel connection of just any two filters - which seems to require root-finding. here in this special case - however - i additionaly know that the sum-filter is allpass. that means that i know my zeros! they are simply obtained by reflection of the poles in the unit circle! tataaa! :party:

remains only the issue with the allpass order asymmetry between upper and lower branch.
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

l0calh05t wrote:
mystran wrote:[...]
I'm fairly certain that doesn't work.

HP1+LP1 = AP1, ok, but HP1*AP3+LP1*AP2 != AP1, 2 or 3 but some other non-allpass filter results

The resulting sum is not allpass.
The trick is that because LPx+HPx = APx, you have:


HP1 * (HP2 + LP2) * AP3 + LP1 * (HP3 + LP3) * AP2

= HP1 * (AP2) * AP3 + LP1 * (AP3) * AP2

= (HP1 + LP1) * (AP2 * AP3)

= AP1 * AP2 * AP3

Post

Robin from www.rs-met.com wrote: remains only the issue with the allpass order asymmetry between upper and lower branch.
Well, assuming the poles of the highpass/lowpass filters agree, then the allpass will be of the same order (and you can indeed process the poles first, and then just apply different zeroes to get the high/lowpass responses).

Post

mystran wrote:The trick is that because LPx+HPx = APx, you have:


HP1 * (HP2 + LP2) * AP3 + LP1 * (HP3 + LP3) * AP2

= HP1 * (AP2) * AP3 + LP1 * (AP3) * AP2

= (HP1 + LP1) * (AP2 * AP3)

= AP1 * AP2 * AP3
Ah, ok, I merely misread your post and ascii art.

Post

Code: Select all

            HP2-process
           /           \
        HP1             Sum2--AP3
       /   \           /         \
      /     LP2-process           \
 input                             output
      \     HP3-process           /
       \   /           \         /
        LP1             Sum3--AP2
           \           /
            LP3-process
where HPx/LPx are flat pair, and APx=HPx+LPx.

So the HP3/LP3 split and resum adds the same phase-shift as the AP3, while the HP2/LP2 split and resum adds the same phase-shift as AP2, and hence the upper and lower branch will sum to flat if the individual HP/LP pairs sum flat
mmhh...wouldn't AP3 have to have the same phase response as LP3/HP3 and AP2 (or vice versa) to make it work. or am i missing something?
Last edited by Music Engineer on Fri Feb 19, 2010 8:05 pm, edited 1 time in total.
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

l0calh05t wrote:
mystran wrote:...
Ah, ok, I merely misread your post and ascii art.
Sorry, I thought I'd be easier than just math, but I guess I should have just written it in prose instead. :)

Post

mystran wrote: Sorry, I thought I'd be easier than just math, but I guess I should have just written it in prose instead. :)
I'm fine with 4 lines of math. Those actually told me more in less time :p

Post

Robin from www.rs-met.com wrote:
mystran wrote:...
mmhh...wouldn't AP3 have to have the same phase response as LP3/HP3 and AP2 (or vice versa) to make it work. or am i missing something?
Nope. AP3 must have the same phase as the sum of LP3 and HP3 responses (which by definition of "flat crossover" is allpass). Likewise, AP2 needs to have the same phase as the sum of LP2 and HP2 responses.

The individual phases of the lowpass/highpass filters are more or less irrelevant. When they are recombined, the result will have some phase-shift, and this is the phase-shift that needs to be compensated.

Post

mystran wrote:you can indeed process the poles first, and then just apply different zeroes to get the high/lowpass responses
:!: what a great idea!
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

Robin from www.rs-met.com wrote:
mystran wrote:you can indeed process the poles first, and then just apply different zeroes to get the high/lowpass responses
:!: what a great idea!
Well depends. For low-order filters it's usually fine. Just like you'd typically want to split higher order filters into a set of biquads, you might have some numerical stability issues here if you apply a large number of poles before any of the zeroes, as the gains tend to get a bit unwieldy. Up to 4th order probably works fine with doubles though.

Post Reply

Return to “DSP and Plugin Development”