Splitting Bands with Linkwitz-Riley

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

Z1202
Given that Butterworth order is odd, there is no +3dB bump in the sum, so what else could we care about?

I'm not aware of any other side-effects in this case either. So to be honest I suspect this is sort of psychological effect:
* For varying-order xovers you just prefer to use the same design for all
* For a fixed-order crossover people tend to choose even orders (2nd as the "cheapest" and 4th as "steep-enough").

Post

Z1202 wrote:While we're on the subject, could I ask a slightly OT question? It seems whenever one needs a crossover, L-R filters seem to be the answer. Why not odd-order Butterworth? They should have flatter passband than L-R of comparable order (if such thing did exist ;) ) Do I miss anything obvious?
The main advantage of L-R is that the bands not only "sum flat" but they are also exactly in phase. So once the bands are split (and all-pass compensated where necessary) you can treat them basically as if the cross-over was linear phase. So if you manipulate the gains (or maybe the mid-side image) of the individual bands, you won't get any nasty surprises due to phase interactions or anything stuff like that.

In comparison, if you have something like a first-order cross-over that sums flat but has a 90 degrees phase difference between the high and low bands, manipulating the gains would change the phase of the recombined output around the cross-over and if you tried to do something like manipulate the stereo width by changing the side-channel gain of one band, you end up with a fairly screwed up stereo image in the cross-over region when the phase doesn't match properly.

The Rane document that Max M. linked speaks about some similar effects that happen in air when you use various cross-overs for speaker design.. but like in general having all your bands properly "in phase" rather than say 90 degrees from each other is useful if you want to mess with the signal in a predictable way.

Post

mystran wrote:So once the bands are split (and all-pass compensated where necessary) you can treat them basically as if the cross-over was linear phase. So if you manipulate the gains (or maybe the mid-side image) of the individual bands, you won't get any nasty surprises due to phase interactions or anything stuff like that.
Makes sense. Didn't occur to me. Thanks.

Post

To me either. I also missed that the varying phase of the output may be critical for multichannel use-cases (aside of speakers->ears areas).

Post

Z1202 wrote:
Hmmm, pretty long text. Quite a few points I have not been aware of (so thanks for the link), however they seem to be relevant for the speaker design. It's not immediately obvious to me which of those stay important if we just use a crossover to split a signal path and then merge it back. Given that Butterworth order is odd, there is no +3dB bump in the sum, so what else could we care about? Maybe the in-phase property, but why?
Here is a guess based on long-ago experience/hardware hacking. The ideas could be easily tested. I just haven't tested it for a long time. Maybe I made wrong conclusions somehow.

The first time I tried making a simple 2 band compressor in the 1970's, it was a tunable first-order 2 way buffered RC crossover, with tuning accomplished with a stacked potentiometer, so the crossover point could be tuned with one knob "fairly close tracking" hipass vs lopass from bass up into high mids.

Then hipass and lopass routed into two simple opto compressors with threshold and output level controls, mixed back together for the final output. With the compressors threshold set too high to modulate gain, the mixed output sounded "natural" and fairly flat. Any static mix of the hipass + lopass sounded "natural" like gentle EQ. Turn down the lopass like a bass cut but no audible oddities. Or turn down the hipass like a treble cut with no audible oddities, just soundling like gentle natural treble cut. Etc.

But for instance if the high and low outputs might be mixed equally for flat frequency response in absence of gain modulation, then lower the threshold knobs so that maybe bass and kick drum cuts lopass on beats 1 and 3, and maybe snare drum and other midrange instruments mainly pump the highpass gain on beats 2 and 4-- When the lopass compressor is highest gain the mixed output phase shift moves toward a max of -45 degrees, and when lopass and hipass compressors are about the same gain the output phase shift is "about zero degrees", and when the hipass compressor is loudest the mixed output phase moves toward a max of +45 degrees.

This constant phase modulation within the bounds of -45 and +45 degrees sounded very unnatural, like a weird wah-wah effect. Maybe with very conservative tiny gain changes the phase modulation would be minor enough to sound "natural", but when I was young'n'dumb I used fairly heavy compressor settings and the sound was too artificial to use as a transparent 2 band compressor effect. Only useful if you actually wanted a fubar unnatural sound rather than transparent multiband compression.

Some of the old tube phase-shift "true vibrato" circuits from the 1940's could achieve rather deep "true vibrato" with only a max of 90 degree moving phase modulation. Therefore any multiband compressor with odd-order crossovers, outputs 45 or 90 or whatever degrees apart from each other-- If the gain is not modulated as with a speaker crossover, the result will sound natural because whatever phase shift happens in the vicinity of the crossover frequency is static and the ear takes little notice. So long as such gentle phase shift over the crossover region is static un-moving and the bands mix together "flat enough" then the mixed output sounds natural.

But if pumping the compressors causes moving phase shifts in the crossover frequency regions, then to my ear the result is too unnatural sounding to qualify as a transparent effect. Because the ear is so sensitive to pitch, perhaps some of the unnatural sound from pumped compressor moving phase shift is the ear perceiving transient pitch modulations, but tis only a wild guess. I just recall that it sounded too unnatural to use as a transparent multiband compressor when I tried it.

Some expensive multiband dynamics hardware uses first-order or other odd-order crossovers. I've not used such gadgets and dunno if they sound similarly unnatural as were my experiments.

Linkwitz Riley multiband dynamics algorithms I tested seemed to sound more transparent, but a couple of years ago was thinking about it, and even pumped LR crossovers might make time-delay modulations as the relative mix is changed by the pumped compressor gains. So maybe LR crossovers are no magic bullet for achieving "natural" multiband compression. Dunno. I haven't written or tested any code in that topic for at least a decade, and been several decades since making LR-crossover multiband analog compressors. Just to my memory the LR multiband compressors sounded more "natural" but if I was to revisit and retest maybe would discover some other conclusion.

Post

JCJR wrote:Here is a guess based on long-ago experience/hardware hacking...
This sounds in agreement to what mystran wrote. Thanks for sharing your practical experience.

Post

Z1202 wrote:
JCJR wrote:Here is a guess based on long-ago experience/hardware hacking...
This sounds in agreement to what mystran wrote. Thanks for sharing your practical experience.
I spent too long typing the response and began the missive before mystran's message showed up here. If I had seen mystran's message perhaps wouldn't have bothered to type so much boring detail. :)

Post

LR avoids the changing time-delay (with band-gain modulation), but it doesn't avoid the frequency dependent time-delay (rather you pay with some extra). So it's not necessarily entirely "transparent" if the cross-over frequency is low enough (eg. below a few hundred Hz or so; for higher frequencies the ear is not very sensitive to these things); you get some coloration that can be fairly obvious on instruments like kick drums and snappy bass, but the good news is that it's static. Whether it sounds more or less "natural" than the potential smearing/preringing that you would get from a similar linear-phase cross-over is probably subjective and/or signal and application dependent.

Post

I am trying to follow your answers and I get an idea about the problem. Just to clarify, I want to repeat it with my own words.
The first split is save to sum because the split has been created with the same cutoff-frequency for the highpass and lowpass version. The magnitudes and phases are perfectly in sync and that is all we are asking for.
Now for the seconds split we are using two different cutoff-frequencies and that is why the outcome of the 4 new bands have phase invariances.
The solution is to introduce an allpass filter for each split for the remaining (already computed bands) to get the phases in sync again.

According to viewtopic.php?f=33&t=479651&start=15#p6713683 there are better and more cpu-friendly solutions but that is what I figured for now.

One question, before I try to understand the (probably) better solution above: Is there an allpass version of the Linkwitz-Riley filter which would allow me to use one filter instead of two (to be summed)?

Post

andremichelle wrote: One question, before I try to understand the (probably) better solution above: Is there an allpass version of the Linkwitz-Riley filter which would allow me to use one filter instead of two (to be summed)?
Linkwitz-Riley is a cascade of 2 Butterworth filters (of some order N), meaning an LR lowpass is what you get when you put two Butterworth low-pass filters in series. The sum of the LR high/low bands is a single Butterworth all-pass (of the same order N).

Post

andremichelle wrote:I am trying to follow your answers and I get an idea about the problem. Just to clarify, I want to repeat it with my own words.
The first split is save to sum because the split has been created with the same cutoff-frequency for the highpass and lowpass version. The magnitudes and phases are perfectly in sync and that is all we are asking for.
Now for the seconds split we are using two different cutoff-frequencies and that is why the outcome of the 4 new bands have phase invariances.
The solution is to introduce an allpass filter for each split for the remaining (already computed bands) to get the phases in sync again.

According to viewtopic.php?f=33&t=479651&start=15#p6713683 there are better and more cpu-friendly solutions but that is what I figured for now.

One question, before I try to understand the (probably) better solution above: Is there an allpass version of the Linkwitz-Riley filter which would allow me to use one filter instead of two (to be summed)?
Well, 2 splits would give three bands not four bands.
viewtopic.php?f=33&t=479651&start=15#p6716815
Matt42's second image in the post linked above shows how to allpass correct the first split lopass, to make it have the same phase curve as the second split's lopass and hipass outputs. That first split's lopass correction filter is tuned to the second split's center frequency, To add more bands, you would just grow the tree, adding new splits and new allpass filters to the previous split outputs so that all the outputs have the same cumulative phase curve at the end of the day. If there are numerous bands then the cumulative phase curve would be rather tortuous. :)

So far as I know, "conventional" allpass filters have double the total phase shift compared to the same-order lopass or hipass. A 4th-order LR crossover would need 2nd-order allpass correction filters to match the 4th order lopass or hipass phase curve.

\For lopass or hipass, total phase shift from DC to very high frequencies would be about 90 degrees per pole. 1st order = 90 degrees, 2nd order = 180 degrees, 4th order = 360 degrees, etc.

But allpass total phase shift is double-- 1st order = 180 degrees, 2nd order = 360 degrees, etc.

For allpass, hipass and lopass, half of the total phase shift is at the filter center frequency.

The Q of the filters affects the steepness of the phase curve in vicinity of the filter center frequency. A low-Q filter has a relatively gentle phase curve. As filter Q is increased, the majority of phase shift gets bunched up closer and closer to the center frequency so that there is less phase change far away from the center frequency, and more drastic phase change near the center frequency.

So the Fc of the filters have to be tuned together, and the allpass filter Q set so that the phase curve of the allpass correction filter has the same shape as the higher-order filters of the crossover lopass and hipass at the same Fc.

According to advice from mystran long ago, if you use 4th order linkwitz-riley:
The lopass would be two butterworth 2nd-order lopass in series, each 2nd-order lopass Q = 0.7071
The hipass would be two butterworth 2nd-order hipass in series, each 2nd-order hipass Q = 0.7071
The allpass correction filter would be a single 2nd-order allpass with Q = 0.7071

I long ago made a mistake and used a wrong Q value for the correction filter and didn't get perfectly flat results.

The above LR 4th order crossover element (without the correction filter) uses four 2nd-order filters.

So far as I understand, mystran's optimization would use two 2nd-order filters for the 4th order lowpass, and also feed the input signal thru a third 2nd-order allpass tuned the same as the lopass. The allpass would make a copy of the input with the same phase curve as the 4th order lopass. Which would allow extraction of the 4th order hipass by-- hipass = AllpassOutput - LopassOutput.

So you could get the 4th order LR split with three 2nd-order filters rather than four 2nd-order filters. But if your crossover has more than two bands, you still need to string together the allpass correction filters to the earlier crossover split outputs.

The 2nd order ZDF state variable filter is well-behaved. I've not tried this, but probably you could also get the same 4th order LR crossover with three 2nd-order filters by first splitting thru the lopass and hipass outputs of a 2nd order ZDF state variable filter, Q = 0.7071, and then feed the SVF lopass output into a 2nd-order Q = 0.7071 lopass, and feed the SVF hipass output into a 2nd-order Q = 0.7071 hipass.

It ought to yield a three-filter 4th order crossover either way, but maybe implementation details would make one version run faster or better than the other version, dunno.

Post

So you could get the 4th order LR split with three 2nd-order filters rather than four 2nd-order filters.

If you use any multi-mode topology (where you have LP and AP outputs simultaneously, e.g. SVF) the three filters collapse to just two.

Post

Max M. wrote:So you could get the 4th order LR split with three 2nd-order filters rather than four 2nd-order filters.

If you use any multi-mode topology (like for example, where you have LP and AP simultaneously, e.g. SVF) the three filters collapse to just two.
Thanks Max. That is inspiring.

Is this what you mean (using for example two 2nd order SVF to make 4th order Linkwitz Riley)?

Code: Select all

                               |--> SVF_A_AllPass --> [ LinkwitzRiley HiPass = SVF_A_AllPass - SVF_B_LoPass ]
                               |
Input --> SVF_A -->|--> SVF_A_LoPass --> SVF_B --> [ LinkwitzRiley LoPass = SVF_B_LoPass ]
I'd need to find time to test and find out if that is all would be necessary. My memory is foggy about some SVF details. Today I looked it up in a couple of old books and some online references, to find contradictory information about some SVF details, such as relative phase and polarity of the outputs. So I would need to test that ZDF digital State Variable Filter to make sure of the output polarities and phase plots.

Maybe there are variations in SVF analog topologies which cause contradictions in the references about output polarities and such, but regardless I'd need to test that aspect of Z1202's SVF to wire it up correctly.

I don't recall needing Allpass from an SVF. A couple of references claim that SVF Allpass = Input - 2 * UnityGainBandpass

Assuming that the lopass, bandpass and highpass phase plots have identical shape with the bandpass phase plot "vertically in-between" the hipass phase plot above and lopass phase plot below then first glance looks like maybe it would work as above, For instance if the ZDF SVF has a phase plot similar to the illustration on page 2 here-- https://ccrma.stanford.edu/~jos/svf/svf.pdf

Post

Allpass = Input - 2 * UnityGainBandpass

Yes, it is.

Post

JCJR wrote:I don't recall needing Allpass from an SVF. A couple of references claim that SVF Allpass = Input - 2 * UnityGainBandpass


Hi JCJR,

Sorry if this isn't helpful. Anyway the outputs of SVF are easily deduced from the numerator of the transfer function.

Image
(just needed the diagram, but all the text is embedded in the image)

So, the numerator for allpass: s^2 -s/q + 1 gives the output coefficients b0 =1, b1= -1/q, b2 = 1

The input - 2*bandpass form is just derived from

Code: Select all

input = (s^2+s/q+1)/(s^2+s/q+1);
bandPass = (s/q)/(s^2+s/q+1);
input - 2 * bandPass = (s^2 -  s/q +1) / (s^2+s/q+1) = allPass; 
Edit: Again apologies if this is obvious, but the digital form of the SVF will need to be ZDF/trapezoidal/TPT to work correctly for LR filters. Such as the ones in this Cytomic paper.

Post Reply

Return to “DSP and Plugin Development”