mutliband-crossover IIR-design with allpass-sum?

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

mystran wrote: 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.
yup, looking a bit closer at the diagram (which, btw., i appreciate), it's now pretty clear that you are right. so no asymmetry in the orders of the allpasses for the 4-way crossover, then. great. thanks for clarifying.
Last edited by Music Engineer on Fri Feb 19, 2010 8:25 pm, edited 1 time in total.
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

mystran wrote: 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.
indeed. current implementation is biquad-cascade. earlier this day, i switched to a direct-form (hoping for performance boost) but had to see that it doesn't work with my fairly high order filters. performance got worse anyway, so i happily switched back to biquad cascade. responds also better to modulation - where better means actually: less crappy

edit: oh i'm belaboring a different thing than you were pointing at - i should read more carefully before replying
Last edited by Music Engineer on Fri Feb 19, 2010 11:53 pm, edited 1 time in total.
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

What kind of implementation would you generally recommend, mystran? Direct-Form II is obviously nice to save memory, but also the most prone to quantization/stability problems. But is there a "best" implementation? I mean, a higher-order filter can be split into cascaded or parallel biquads, but there are so many other things like lattice filters etc... or is it only a matter of experimentation.

Post

l0calh05t wrote:What kind of implementation would you generally recommend, mystran? Direct-Form II is obviously nice to save memory, but also the most prone to quantization/stability problems. But is there a "best" implementation? I mean, a higher-order filter can be split into cascaded or parallel biquads, but there are so many other things like lattice filters etc... or is it only a matter of experimentation.
I'm hardly an expert on this, but I usually just use direct form biquads (usually DF1 actually) if I don't need smooth parameter adjustments or internal saturations or any other fancy stuff. My favourite "stock" topology when I do want some fancy stuff would probably be the lattices. I'm beginning to think that I could convert my stock biquad code to use lattices too without much harm done, but whatever.

That said, I'm the wrong person to talk to with regards to high-order filters, because I generally don't like how they sound (well, I don't like steep filters, and if you don't need a steep filter, you don't necessarily need very high order either), and only really tend to use them where I need regular engineering performance (say oversampling something), or in special situations (which again need to be thought case by case).

Post

So far I've been using mostly DF2 which although probably the least stable works fine for biquads and 64-bit. Haven't needed that many high-order filters either so far, except for oversampling where I tend to use FIRs.

Post

Oh and this is probably obvious, but just in case it is not... given a lowpass filter, it is rather simple to construct an allpass filter with the same poles. If one then substracts the lowpass from the allpass (make sure phase matches at DC; invert the allpass if you got it wrong way), one gets a high-pass filter which will sum flat with the original lowpass. This way you could construct a flat-summing cross-over pair from any lowpass filter (how to get a good one, I have no idea; haven't tried).

Compared to simply using your favourite filter design for high/low-pass separately, and hoping that the result sums flat, the above should be fairly fool-proof, and allows flexibility in the shape of the cross-over. Obviously if the lowpass filter has ripple in passband, then the highpass will have ripple in stop-band, and vice versa, but the recombination sum will stay flat if neither band is modified.

For situations where gain must stay below unity (say inside some feedback loop) it should be mentioned that if the low-band has ripple, then lowering gain of the high-band can actually increase gain at the ripple-peak frequencies when recombining and likewise for high-band ripple and lowering low-band gain. If the amplitude response of the original lowpass is strictly between 0 and 1, then one should be safe (though no warranty, hehe).

Post

...double post
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

mystran wrote:Oh and this is probably obvious, but just in case it is not... given a lowpass filter, it is rather simple to construct an allpass filter with the same poles.

O.K. - just move the zeros from z = -1 to z = 1/p*, right? (...and 1/p should do equally well, since the poles come in complex conjugate pairs anyway)
If one then substracts the lowpass from the allpass (make sure phase matches at DC; invert the allpass if you got it wrong way), one gets a high-pass filter which will sum flat with the original lowpass.
it's not really obvious to me right now, why this subtraction should then place all the resulting zeros at z = +1 (which, IMHO, it should for a proper highpass). does it?
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

Robin from www.rs-met.com wrote:
mystran wrote:Oh and this is probably obvious, but just in case it is not... given a lowpass filter, it is rather simple to construct an allpass filter with the same poles.

O.K. - just move the zeros from z = -1 to z = 1/p*, right? (...and 1/p should do equally well, since the poles come in complex conjugate pairs anyway)
Yeah, though there's a shortcut if you're working with transfer functions directly.
If one then substracts the lowpass from the allpass (make sure phase matches at DC; invert the allpass if you got it wrong way), one gets a high-pass filter which will sum flat with the original lowpass.
it's not really obvious to me right now, why this subtraction should then place all the resulting zeros at z = +1 (which, IMHO, it should for a proper highpass). does it?
Hmmh. Good question, which I admit I have to think of this with more time. My initial post was no good since I made an obviously totally bogus assumption. It's messy. :|

Post

mystran wrote:Yeah, though there's a shortcut if you're working with transfer functions directly.
you mean 'transfer-function' in the sense that the numerator and denominator polynomials are given as sum_k a_k z^k (rather than in product-form)? yeah, later it occured to me too that there was something about allpasses and polynomials with reversed-order coefficients...and negation...or something. ...need to look that up when needed
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

Ok, so I can prove for single complex one-pole that allpass-lowpass = highpass (with some nasty gain coeff which is complex for complex pole).

I'm currently trying to find the time (ok, ok, I'm trying to bring myself to) see whether I can take the induction step and prove it for arbitrary order (or alternatively disprove that it doesn't work in general case, hopefully getting some condition out of the result).

OR if someone else wants to answer this question, feel free to. I'm interested in the result as well (which is why I'm trying to bring myself to actually work on it; it's just that I'm not very good at math, which means I need to focus to get it right). :D

Post

Ok, it definitely seems there's no way to make all zeroes of the "highpass" end up at +1. In fact I have some trouble finding any solutions at all beyond 1st order, where "proper" high-pass and low-pass filters would sum all-pass (at least if the poles are required to be stable).

I guess I must be doing something wrong? Gotta work on this more :(


edit: nevermind, found the problem (ie. bad math) :D

Post

O.K. it seems like i have the allpass-compensation working. it surprised me a bit that the allpass resulting from adding the two butterworth-squared high-/lowpass-filters actually comes out as non-squared butterworth-allpass. half of the zeros end up inside the unit-circle, canceling with half of the poles. i found this only experimentally, still wondering about the theoretical explanantion.
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

Robin from www.rs-met.com wrote:O.K. it seems like i have the allpass-compensation working. it surprised me a bit that the allpass resulting from adding the two butterworth-squared high-/lowpass-filters actually comes out as non-squared butterworth-allpass. half of the zeros end up inside the unit-circle, canceling with half of the poles. i found this only experimentally, still wondering about the theoretical explanantion.
Yeah I actually think I noticed that too when I was trying to sanity check my math.

Post

mystran wrote:Yeah I actually think I noticed that too when I was trying to sanity check my math.
i actually expected that for each repeated pole inside the unit circle (where the repeat is due to squaring), there would be a repeated zero outside the unit circle. instead, there's only one outside and the other one is sitting inside on the repeated pole-pair, thereby canceling one. and that's good because it reduces the order of the compensation allpass - but i still wonder why this is so. whether there's some kind of deep explanation. i can't see any obvious one right now.

...but be that as it may. it works and so i'm happy. :D thanks to all
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post Reply

Return to “DSP and Plugin Development”