Root solving every sample... au weia.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...
mutliband-crossover IIR-design with allpass-sum?
-
- KVRist
- 213 posts since 30 Dec, 2006 from Darmstadt, Germany
-
Music Engineer Music Engineer https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=15959
- KVRAF
- Topic Starter
- 4379 posts since 8 Mar, 2004 from Berlin, Germany
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.l0calh05t wrote:Root solving every sample... au weia.
of course, i could apply smoothing - but nah!
-
- KVRist
- 213 posts since 30 Dec, 2006 from Darmstadt, Germany
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.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!
- KVRAF
- 8484 posts since 12 Feb, 2006 from Helsinki, Finland
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:
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
HP2-process
/ \
HP1 Sum2--AP3
/ \ / \
/ LP2-process \
input output
\ HP3-process /
\ / \ /
LP1 Sum3--AP2
\ /
LP3-process
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.
-
- KVRist
- 213 posts since 30 Dec, 2006 from Darmstadt, Germany
I'm fairly certain that doesn't work.mystran wrote:[...]
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.
-
Music Engineer Music Engineer https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=15959
- KVRAF
- Topic Starter
- 4379 posts since 8 Mar, 2004 from Berlin, Germany
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!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.
remains only the issue with the allpass order asymmetry between upper and lower branch.
- KVRAF
- 8484 posts since 12 Feb, 2006 from Helsinki, Finland
The trick is that because LPx+HPx = APx, you have:l0calh05t wrote:I'm fairly certain that doesn't work.mystran wrote:[...]
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.
HP1 * (HP2 + LP2) * AP3 + LP1 * (HP3 + LP3) * AP2
= HP1 * (AP2) * AP3 + LP1 * (AP3) * AP2
= (HP1 + LP1) * (AP2 * AP3)
= AP1 * AP2 * AP3
- KVRAF
- 8484 posts since 12 Feb, 2006 from Helsinki, Finland
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).Robin from www.rs-met.com wrote: remains only the issue with the allpass order asymmetry between upper and lower branch.
-
- KVRist
- 213 posts since 30 Dec, 2006 from Darmstadt, Germany
Ah, ok, I merely misread your post and ascii art.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
-
Music Engineer Music Engineer https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=15959
- KVRAF
- Topic Starter
- 4379 posts since 8 Mar, 2004 from Berlin, Germany
Code: Select all
HP2-process
/ \
HP1 Sum2--AP3
/ \ / \
/ LP2-process \
input output
\ HP3-process /
\ / \ /
LP1 Sum3--AP2
\ /
LP3-process
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?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
Last edited by Music Engineer on Fri Feb 19, 2010 8:05 pm, edited 1 time in total.
- KVRAF
- 8484 posts since 12 Feb, 2006 from Helsinki, Finland
Sorry, I thought I'd be easier than just math, but I guess I should have just written it in prose instead.l0calh05t wrote:Ah, ok, I merely misread your post and ascii art.mystran wrote:...
-
- KVRist
- 213 posts since 30 Dec, 2006 from Darmstadt, Germany
I'm fine with 4 lines of math. Those actually told me more in less time :pmystran wrote: Sorry, I thought I'd be easier than just math, but I guess I should have just written it in prose instead.
- KVRAF
- 8484 posts since 12 Feb, 2006 from Helsinki, Finland
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.Robin from www.rs-met.com 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?mystran wrote:...
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.
-
Music Engineer Music Engineer https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=15959
- KVRAF
- Topic Starter
- 4379 posts since 8 Mar, 2004 from Berlin, Germany
mystran wrote:you can indeed process the poles first, and then just apply different zeroes to get the high/lowpass responses
- KVRAF
- 8484 posts since 12 Feb, 2006 from Helsinki, Finland
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.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 responseswhat a great idea!
