Hey guys, I did a digital crossover for audio using classical R'b'j biquads, it can have variable number of bands spilled between 20Hz-20kHz. Every band is processed using the same number of filters - lp, hp and allpass for phase-compensation. When 2 bands are too close enough, without allpass it is useless, it can create even 20dB peak/notch. With the allpass it is much better, but still it can create nearly 2dB peak when the limits are too close (say one band is 2kHz-2.001kHz). I know that mathematically it should be perfectly flat (one of you showed it actually :)). But well, this is real world, so who knows... Any ideas what it could be? Inaccuracy of 64-bit floating point arithmetics? Imprefect response of the allpass compared to hp/lp? Thanks in advance. jungledmnc

# Linkwitz-Riley response not perfectly flat

Started by ●May 15, 2009

Reply by ●May 15, 20092009-05-15

jungledmnc wrote:> Hey guys, > I did a digital crossover for audio using classical R'b'j biquads, it can > have variable number of bands spilled between 20Hz-20kHz. Every band is > processed using the same number of filters - lp, hp and allpass for > phase-compensation. When 2 bands are too close enough, without allpass it > is useless, it can create even 20dB peak/notch. With the allpass it is much > better, but still it can create nearly 2dB peak when the limits are too > close (say one band is 2kHz-2.001kHz). > > I know that mathematically it should be perfectly flat (one of you showed > it actually :)). But well, this is real world, so who knows... Any ideas > what it could be? Inaccuracy of 64-bit floating point arithmetics? > Imprefect response of the allpass compared to hp/lp?Mathematically, the analog design is perfectly flat. Why do you assume that the biquad approximation will also be flat? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������

Reply by ●May 16, 20092009-05-16

Jerry Avins wrote:> jungledmnc wrote:>> I did a digital crossover for audio using classical R'b'j >> biquads, it can have variable number of bands spilled between >> 20Hz-20kHz. Every band is processed using the same number of >> filters - lp, hp and allpass for phase-compensation. When 2 >> bands are too close enough, without allpass it is useless, it >> can create even 20dB peak/notch. With the allpass it is much >> better, but still it can create nearly 2dB peak when the limits >> are too close (say one band is 2kHz-2.001kHz). >> >> I know that mathematically it should be perfectly flat (one of >> you showed it actually :)). But well, this is real world, so >> who knows... Any ideas what it could be? Inaccuracy of 64-bit >> floating point arithmetics? Imprefect response of the allpass >> compared to hp/lp? > > Mathematically, the analog design is perfectly flat. Why do you > assume that the biquad approximation will also be flat?It really is because all 2nd-order sections involved, having the same critical frequency, are subjected to the same instance of the bilinear transform. Anyway, a plot leaves nothing to assume -- displaying 1 - abs(sum of band transfer functions) shows numerical noise but no systematic deviation. Martin -- Quidquid latine scriptum est, altum videtur.

Reply by ●May 16, 20092009-05-16

jungledmnc wrote:> I did a digital crossover for audio using classical R'b'j > biquads, it can have variable number of bands spilled between > 20Hz-20kHz. Every band is processed using the same number of > filters - lp, hp and allpass for phase-compensation. When 2 > bands are too close enough, without allpass it is useless, it > can create even 20dB peak/notch. With the allpass it is much > better, but still it can create nearly 2dB peak when the limits > are too close (say one band is 2kHz-2.001kHz).Please describe exactly what your signal flow looks like. How do you wire up splitters and allpasses to form a multiband network? Martin -- Quidquid latine scriptum est, altum videtur.

Reply by ●May 16, 20092009-05-16

On May 15, 1:07�pm, Jerry Avins <j...@ieee.org> wrote:> jungledmnc wrote:..> > I did a digital crossover for audio using classical R'b'j biquads, it can > > have variable number of bands spilled between 20Hz-20kHz. Every band is > > processed using the same number of filters - lp, hp and allpass for > > phase-compensation. When 2 bands are too close enough, without allpass it > > is useless, it can create even 20dB peak/notch. With the allpass it is much > > better, but still it can create nearly 2dB peak when the limits are too > > close (say one band is 2kHz-2.001kHz). > > > I know that mathematically it should be perfectly flat (one of you showed > > it actually :)). But well, this is real world, so who knows... Any ideas > > what it could be? Inaccuracy of 64-bit floating point arithmetics? > > Imprefect response of the allpass compared to hp/lp? > > Mathematically, the analog design is perfectly flat. Why do you assume > that the biquad approximation will also be flat?it might be a reasonable assumption. at least the *overall* L-R crossover, when converted from s to z, should be just as flat as the analog when using bilinear transform. no? now i understand sometimes it doesn't add up that way. say for higher order Tchebyshevs, you cannot just apply BLT to each section where you compensate (or "pre-warp") the resonant frequency of each biquad individually (because the resonant frequencies are different for each section). you have to do it to the whole Tchebyshev, and then pull it apart into biquads. maybe something similar is needed for L-R. r b-j

Reply by ●May 17, 20092009-05-17

Hey guys, thanks for helping. So I'll be more specific. Let's say 3 bands, 0-1kHz (A), 1kHz-1kHz (B), 1kHz-20kHz (C). Obviously the B band will not contain much signal (-12dB particulary), so the settings are rather weird, but the artifacts are most visible here. Processing for all bands (Q = sqrt(2)/2): A) LP (1kHz), AP (1kHz) B) LP (1kHz), HP (1kHz) C) AP (1kHz), HP (1kHz) Resulting frequency response when all bands are just summed has approx. 1.95dB peak at 1kHz. I approximated the same response with a peak filter at 1kHz, +1.95dB, Q=1.0, however the peak filter goes slower to 0.0dB (e.g. at 2kHz L-R gets about +0.45dB, but the peak filter +0.6dB), on the top of the peak the approximation is quite good. Thanks again! dmnc

Reply by ●May 17, 20092009-05-17

On Sun, 17 May 2009 11:31:20 -0500, "jungledmnc" <jungledmnc@gmail.com> wrote:>Processing for all bands (Q = sqrt(2)/2): >A) LP (1kHz), AP (1kHz) >B) LP (1kHz), HP (1kHz) >C) AP (1kHz), HP (1kHz)I see the problem. Let's create a generic Linkwitz-Riley 3-way crossover. The Lo band covers 0 Hz to "L" Hz, the Mid band covers "L" Hz to "H" Hz, and the Hi band covers "H" Hz upward. Name the filters "lpL" (lowpass-L), "hpL" (highpass-L), "lpH" (lowpass-H), and "hpH" (highpass-H). From the definition of the Linkwitz-Riley configuration, . lpX +/- hpX = apX, where "X" is the frequency associated with the filters, apX is an allpass filter, and +/- occurs because some crossover orders require addition, others subtraction, for the statement to be true. (In the second order case, it's subtraction. In the fourth order case, it's addition. Etc.) So, for our generic 3-way, let's assume addition, to make the explanation simpler: . lpL + hpL = apL, and . lpH + hpH = apH. A 2-way "L" Hz crossover looks like this (I hope you can use fixed-width font): . +---+ . +--|hpL|-- Lo . | +---+ . --+ . | +---+ . +--|lpL|-- Hi . +---+ Now how do we make it into a 3-way? Easy, right? Just configure as stated in your post: . +---+ +---+ . +--|apL|--|hpH|-- Lo ("C" in your description) . | +---+ +---+ . | . | +---+ +---+ . --+--|hpL|--|lpH|-- Mid ("B" in your description) . | +---+ +---+ . | . | +---+ +---+ . +--|lpL|--|apH|-- Hi ("A" in your description) . +---+ +---+ Wrong! You need for the three outputs to sum to the cascade of the two allpass filters, . Lo + Mid + Hi = apH*apL Well, . apH = lpH + hpH . apL = lpL + hpL So, . apH*apL = (lpH + hpH)*(lpL + hpL) . = lpH*lpL + lpH*hpL + hpH*(lpL + hpL) . = lpH*lpL + lpH*hpL + hpH*apL And the crossover must be configured like this: . +---+ +---+ . +--|apL|--|hpH|-- Hi . | +---+ +---+ . | . | +---+ +---+ . --+--|hpL|--|lpH|-- Mid . | +---+ +---+ . | . | +---+ +---+ . +--|lpL|--|lpH|-- Lo . +---+ +---+ The difference between this and your configuration is the substitution of the lpH filter for the apH filter in the Lo band. Think that's complicated? You should see the 4-way configuration. Greg

Reply by ●May 17, 20092009-05-17

Thanks Greg! It truly works! To be honest, I don't understand it very much, at least I'm not sure, I have to study. Anyway thanks again! dmnc

Reply by ●May 17, 20092009-05-17

On Sun, 17 May 2009 17:16:36 -0500, "jungledmnc" <jungledmnc@gmail.com> wrote:>Thanks Greg! >It truly works! To be honest, I don't understand it very much, at least >I'm not sure, I have to study. >Anyway thanks again!You're welcome. Glad to help. Greg

Reply by ●May 18, 20092009-05-18

Greg Berchin wrote:> . +---+ +---+ > . +--|apL|--|hpH|-- Hi > . | +---+ +---+ > . | > . | +---+ +---+ > . --+--|hpL|--|lpH|-- Mid > . | +---+ +---+ > . | > . | +---+ +---+ > . +--|lpL|--|lpH|-- Lo > . +---+ +---+ > > The difference between this and your configuration is the > substitution of the lpH filter for the apH filter in the Lo > band. > > Think that's complicated? You should see the 4-way > configuration.Please don't scare the demon unnecessarily. It's good that you've sketched the algebraic justification but the construction is principled and simple if you proceed purely by splitting, rather than adding, branches. Starting with the 2-way crossover network <2> below, split the lower branch (say) by inserting another crossover, and keep the phase shift through any branch the same by inserting the appropriate allpass in the unsplit branch. The result <3> is a factored and commuted form of Greg's last flowgraph: ,--> ,--[A2]---> -->[C1] -->[C1] ,--> `--> `--[C2] `--> <2> <3> To make a 4-way, put another crossover on one outlet and an instance of the appropriate allpass on every other outlet, then push the allpasses as far as possible up the tree to minimize the number of computational blocks. Let's pick the uppermost branch for prettiness, resulting in <4.1>; and let's do it again picking another branch of the 3-way to make the point, in <4.2>. ,--> ,->[A2]-->[A1]---> ,->[A2]->[C3]---> / ,--> ->[C1] ->[C3] ,->[C1] `->[A3]->[C2]---> `-->[C2] `--> `--> `->[A1]---> <4a> <4b> Take note of the relabeling -- equal-numbered blocks have equal critical frequencies (w2 < w1 < w3) between <4a> and <4b> so that both networks realize the same decomposition. Also observe that the network <4b> makes you calculate more because we can't commute the instances of A1 up the tree until they fuse as we did with A3 in <4a>. So which form to choose? For minimal calculation, arrange crossovers in a balanced binary tree, splitting first on the middle (by count) bandedge and recursing on the high and low ranges. However, for noise performance it may be preferable to split high channels more often because of two factors. First, a filter block's SNR worsens with decreasing critical frequency (at fixed Q, as we have here) and we can combat this by choosing a low-noise topology for blocks in the lowest branches. Now, those topologies are more expensive than the direct forms but -- second -- this is counterbalanced if we apply them to allpasses, which are simpler than magnitude filters to begin with. And coming around, splitting high branches first concentrates the allpass blocks in the low branches and therefore may help to alleviate noise gain while checking cost growth. The reason I've used the weasel word "may" is that, as mentioned below fig. <4>, unbalanced splitting also increases the sheer number of filter blocks and I don't know how to make the noise/cost tradeoff except by simulating and comparing different crossover trees. Martin -- Quidquid latine scriptum est, altum videtur.