Problem with -12db/oct crossover network
-
- KVRAF
- Topic Starter
- 7400 posts since 17 Feb, 2005
I've been attempting to make one using Reaktor's included core filter modules. I think these are RBJ type filters. I have it mostly setup correctly, the bands are flip flopped and I'm using 6 of them. It's supposed to sum to flat voltage, and it does so far, but I had to adjust gains on the outputs of the bands independently. So my question is if it sums correctly, is it correct, or is there something obviously wrong? How would using the bands independently be approached because the gain of each is different. The bands themselves are 1 decade wide.
-
- KVRAF
- 3080 posts since 17 Apr, 2005 from S.E. TN
If you are splitting into multiple bands, then want to process each band and mix back flat. A guess might be phase shift problems.
If you have a "tree" of two-way crossovers, going from high frequency to low frequency, resulting in top band = hipass, next lower band lowpass of the highest crossover frequency plus hipass of the next-highest crossover frequency, etc. After several 2 way splits like that, the lowest bands have more cumulative phase shift in the "band stop" regions, compared to higher bands that did not go thru so many filters.
The out-of-band signal is attenuated in each band, but it is still there at some level, and the phase differences can prevent mixing flat.
I think allpass filters could be added to the upstream bands, so the upstream bands stay "phase aligned" with with lower bands that had to pass thru more crossover filters, and therefore were more extremely phase shifted.
If you have a "tree" of two-way crossovers, going from high frequency to low frequency, resulting in top band = hipass, next lower band lowpass of the highest crossover frequency plus hipass of the next-highest crossover frequency, etc. After several 2 way splits like that, the lowest bands have more cumulative phase shift in the "band stop" regions, compared to higher bands that did not go thru so many filters.
The out-of-band signal is attenuated in each band, but it is still there at some level, and the phase differences can prevent mixing flat.
I think allpass filters could be added to the upstream bands, so the upstream bands stay "phase aligned" with with lower bands that had to pass thru more crossover filters, and therefore were more extremely phase shifted.
- KVRist
- 347 posts since 20 Apr, 2005 from Moscow, Russian Federation
Linkwitz-Riley crossovers work by phase-aligning HP/LP outputs just like JCJR described incamsr wrote:I am wondering how a Linkwitz Riley network operates, is there something else going on, or am I really in error by having to adjust the gains?
(In fact, for a 12db/oct crossover, one Linkwitz-Riley splitter can be implemented via minimal parallel/cascade chain of two 1 order allpass filters.)I think allpass filters could be added to the upstream bands, so the upstream bands stay "phase aligned" with with lower bands that had to pass thru more crossover filters, and therefore were more extremely phase shifted.
Note however that while a Linkwitz-Riley crossover has flat frequency response (of its outputs "sum"), its phase response is not flat (i.e. output != input anymore). Thus if you decide to use it to get (for example) 5 bands, the overall phase-shift of your network will be as much as (assuming 12db/oct blocks) 4*180° = 720° at higher frequencies.
P.S. Upd.: Fixed incorrect total phase shift calc.
Last edited by Max M. on Mon Aug 31, 2015 5:59 pm, edited 1 time in total.
-
- KVRAF
- Topic Starter
- 7400 posts since 17 Feb, 2005
Alright, makes sense. I also noticed that near nyquist the stuffing issue causes an inbalance with the 1 decade band. It's off a few dB there when I sum the next band. Any idea where to tune the allpass? Is it a first or second order allpass?
-
- KVRAF
- 3080 posts since 17 Apr, 2005 from S.E. TN
Camsr, others can give better advice. I played a little with LR band splitters more than a few years ago.
One that made it into a dx plugin, was an "analog style" click pop crackle remover, using multiple fourth order LR crossovers. That one mixed flat no problemo. The way it worked, first it did a two way bandsplit at can't recall, 8 or 10 KHz. Then it would declick the high band and mix the two bands back together. Then it would do a 2 way split an octave lower, and declick the top band, and mix the two back together. Did this several times going down the octaves.
The idea was that minor ticks would get cleaned off the first pass or two, until lower scans wouldn't detect any problem, but more severe clicks would get cleaned off in multiple stages until they could no longer be detected.
Seemed to work ok. Surely it had horrible cumulative phase shift, but in my tests on vinyl records could not hear audible damage from the phase shift. Maybe another set of ears would go howling from the phase shift, dunno.
Two way LR splits seemed to always mix flat (unless you muck with the phase of a band before you mix it back together).
I experimented with crossover trees of two way splits for multiband, and the more bands, the less flat it would mix. I expected that, figured the upstream bands need extra phase shift to line up with downstream bands.
I believe my fatal mistake-- A 2nd order allpass should have the same phase shift as a 4th order lowpass or hipass. However, because fourth order LR is two series Q = 0.707 filters, I expected the allpass to need a Q of 0.707^2 = 0.5.
Am pretty sure the topography was correct, but mystran and another fella assure me I shoulda used a Q of 0.707 for the 2nd order allpass. One of these days will revisit the old code and see if that simple change makes it mix flat.
I suspect for your 2nd order LR, you might want 1st order allpasses.
Maybe in a multiband splitter, bands far separated would not have to be exactly phase compensated, but I was figuring, for example if you have 5 splits, then to make sure, you would need enough series allpass connected to the output of the upstream filters, to apply the same cumulative phase shift experienced by the lowest pair of outputs.
IOW, if you crossover at 5KHz followed by 1 KHz, if memory serves you would want to put a 1KHz allpass in series with the top hipass output. Maybe more than that, would need to think about it or look up old notes.
About a year ago mystran mentioned here an easier way to get 4th order LR crossovers. Perhaps the same strategy Max mentioned. If I ever get around to playing with it again, will look it up.
Have wondered if rbj filters would need running upsampled to do a good high frequency crossover. Dunno. The lowpass and hipass act a bit surprising in the top couple of octaves at 44.1 KHz samplerate. Which isn't rbj's fault. BLT's fault most likely.
I didn't notice a problem mixing flat with the click'n'pop remover, so maybe it will mix flat even if the actual crossover shapes look kinda funny at high frequencies.
One that made it into a dx plugin, was an "analog style" click pop crackle remover, using multiple fourth order LR crossovers. That one mixed flat no problemo. The way it worked, first it did a two way bandsplit at can't recall, 8 or 10 KHz. Then it would declick the high band and mix the two bands back together. Then it would do a 2 way split an octave lower, and declick the top band, and mix the two back together. Did this several times going down the octaves.
The idea was that minor ticks would get cleaned off the first pass or two, until lower scans wouldn't detect any problem, but more severe clicks would get cleaned off in multiple stages until they could no longer be detected.
Seemed to work ok. Surely it had horrible cumulative phase shift, but in my tests on vinyl records could not hear audible damage from the phase shift. Maybe another set of ears would go howling from the phase shift, dunno.
Two way LR splits seemed to always mix flat (unless you muck with the phase of a band before you mix it back together).
I experimented with crossover trees of two way splits for multiband, and the more bands, the less flat it would mix. I expected that, figured the upstream bands need extra phase shift to line up with downstream bands.
I believe my fatal mistake-- A 2nd order allpass should have the same phase shift as a 4th order lowpass or hipass. However, because fourth order LR is two series Q = 0.707 filters, I expected the allpass to need a Q of 0.707^2 = 0.5.
Am pretty sure the topography was correct, but mystran and another fella assure me I shoulda used a Q of 0.707 for the 2nd order allpass. One of these days will revisit the old code and see if that simple change makes it mix flat.
I suspect for your 2nd order LR, you might want 1st order allpasses.
Maybe in a multiband splitter, bands far separated would not have to be exactly phase compensated, but I was figuring, for example if you have 5 splits, then to make sure, you would need enough series allpass connected to the output of the upstream filters, to apply the same cumulative phase shift experienced by the lowest pair of outputs.
IOW, if you crossover at 5KHz followed by 1 KHz, if memory serves you would want to put a 1KHz allpass in series with the top hipass output. Maybe more than that, would need to think about it or look up old notes.
About a year ago mystran mentioned here an easier way to get 4th order LR crossovers. Perhaps the same strategy Max mentioned. If I ever get around to playing with it again, will look it up.
Have wondered if rbj filters would need running upsampled to do a good high frequency crossover. Dunno. The lowpass and hipass act a bit surprising in the top couple of octaves at 44.1 KHz samplerate. Which isn't rbj's fault. BLT's fault most likely.
I didn't notice a problem mixing flat with the click'n'pop remover, so maybe it will mix flat even if the actual crossover shapes look kinda funny at high frequencies.
- KVRist
- 347 posts since 20 Apr, 2005 from Moscow, Russian Federation
In short, the AP (first order) should have same F as LP has (and then you simply get HP = AP - LP, I don't know what Q convention is used by Reaktor, but yes, if it's typical RBJ formulae, the Q for LP should be 0.5).camsr wrote:Any idea where to tune the allpass? Is it a first or second order allpass?
Also as I mentioned above, for the second-order crossover (i.e. "12dB/oct" one) it's sort of inefficient implementation (second-order filter + first-order-filter per splitter), since the same can be achieved with two first-order allpass filters:
---
And just in case (I assume you had it right already, but still makes sense to mention since it's quite typical pitfall for multiband LR crossovers), an overall multiband LR thing would look somewhat like this. I.e. each next splitter is fed with the output of the prev. splitter.
P.S. upd.: Fixed the flow diagram (1/4 scaler was in wrong place, sorry).
Last edited by Max M. on Tue Sep 01, 2015 7:00 am, edited 6 times in total.
-
- KVRian
- 1153 posts since 11 Aug, 2004 from Breuillet, France
I have made a 4 bands crossover in the past following some information I have found on another thread on KVR.
I think I did something like that :
Input => LP3 => AP2 => LP1 => Output 1
Input => LP3 => AP2 => HP1 => Output 2
Input => HP3 => AP1 => LP2 => Output 3
Input => HP3 => AP1 => HP2 => Output 4
With LP1, LP2, LP3 4th order lowpass filters, HP1, HP2, HP3 4th order highpass filters, AP1, AP2 2nd order allpass filters. LP1, HP1 and AP1 have the same cutoff frequency f1, the same for LP2, HP2 and AP2 with f2, and the same for LP3 + HP3 with f3. The Q factor is always 1 / sqrt(2). The 4nd order filters are simply two rbj ones cascaded, and the allpass is one rbj one.
Two things are very essential here for the crossover to work. First, you need the extra allpass filters so you get the same phase response on the four paths. If it's not the case, the output will sound very different from the input (I won't say that the output and the input need to be identical obviously since the phase will never be the same).
And second, you need to verify that the sum of the LPn and the HPn filters give you the transfer function of a APn.
Then obviously you can do all the simplifications on the structure you can knowing that LPn + HPn = APn
I think I did something like that :
Input => LP3 => AP2 => LP1 => Output 1
Input => LP3 => AP2 => HP1 => Output 2
Input => HP3 => AP1 => LP2 => Output 3
Input => HP3 => AP1 => HP2 => Output 4
With LP1, LP2, LP3 4th order lowpass filters, HP1, HP2, HP3 4th order highpass filters, AP1, AP2 2nd order allpass filters. LP1, HP1 and AP1 have the same cutoff frequency f1, the same for LP2, HP2 and AP2 with f2, and the same for LP3 + HP3 with f3. The Q factor is always 1 / sqrt(2). The 4nd order filters are simply two rbj ones cascaded, and the allpass is one rbj one.
Two things are very essential here for the crossover to work. First, you need the extra allpass filters so you get the same phase response on the four paths. If it's not the case, the output will sound very different from the input (I won't say that the output and the input need to be identical obviously since the phase will never be the same).
And second, you need to verify that the sum of the LPn and the HPn filters give you the transfer function of a APn.
Then obviously you can do all the simplifications on the structure you can knowing that LPn + HPn = APn
Last edited by Ivan_C on Mon Aug 31, 2015 6:32 pm, edited 1 time in total.
-
- KVRian
- 1153 posts since 11 Aug, 2004 from Breuillet, France
In the -12 dB/oct case, you have two transfer functions HLP(s) = 1 / (1 + Rs + s²) and HHP(s) = s² / (1 + Rs + s²) in the normalized Laplace domain.
In fact, you can't just sum them, you need also to invert the output of the HP filter ! This way, the sum is the following :
HLP(s) - HHP(s) = 1 / (1 + Rs + s²) - s² / (1 + Rs + s²) = (1 - s²) / (1 + Rs + s²)
If R = 2 (Q = 0.5), you can write :
HLP(s) - HHP(s) = (1 + s) (1 - s) / ((1 + s) (1 + s)) = (1 - s) / (1 + s) = HAP(s)
This is an allpass filter of the 1st order.
In fact, you can't just sum them, you need also to invert the output of the HP filter ! This way, the sum is the following :
HLP(s) - HHP(s) = 1 / (1 + Rs + s²) - s² / (1 + Rs + s²) = (1 - s²) / (1 + Rs + s²)
If R = 2 (Q = 0.5), you can write :
HLP(s) - HHP(s) = (1 + s) (1 - s) / ((1 + s) (1 + s)) = (1 - s) / (1 + s) = HAP(s)
This is an allpass filter of the 1st order.
-
- KVRAF
- 3080 posts since 17 Apr, 2005 from S.E. TN
Mr Linkwitz's web site has specs for making 2nd order LR filters, along with higher orders, but I didn't pay much attention to the 2nd order case.
I've sketched topologies where all bands get direct input, rather than a tree of 2 way crossovers as in the LR tree Max posted but had trouble understanding a parallel configuration. Looks like Wolfen666 has something that works.
http://www.linkwitzlab.com/images/graph ... oved-s.png
(Am not arguing btw, just discussing with my limited understanding)
In that tree four way crossover image, T and M would mix flat, but W would not quite mix flat. Maybe close, but I think W needs a series allpass at 2 KHz to get the phase aligned with T and M at frequency extremes.
Similarly Output SW would probably need allpasses at 250 Hz and 2 KHz to phase align to frequency extremes.
Maybe there would be a smarter place to put the allpasses rather than in series at the outputs. A way to minimize the number of allpasses in case of a large number of bands. Dunno. Maybe in an old notebook there are better layouts sketched. Spent awhile thinking about it some years ago.
As best I recall, Mr Linkwitz had a page discussing the allpass phase adjustment filters as well.
I've sketched topologies where all bands get direct input, rather than a tree of 2 way crossovers as in the LR tree Max posted but had trouble understanding a parallel configuration. Looks like Wolfen666 has something that works.
http://www.linkwitzlab.com/images/graph ... oved-s.png
(Am not arguing btw, just discussing with my limited understanding)
In that tree four way crossover image, T and M would mix flat, but W would not quite mix flat. Maybe close, but I think W needs a series allpass at 2 KHz to get the phase aligned with T and M at frequency extremes.
Similarly Output SW would probably need allpasses at 250 Hz and 2 KHz to phase align to frequency extremes.
Maybe there would be a smarter place to put the allpasses rather than in series at the outputs. A way to minimize the number of allpasses in case of a large number of bands. Dunno. Maybe in an old notebook there are better layouts sketched. Spent awhile thinking about it some years ago.
As best I recall, Mr Linkwitz had a page discussing the allpass phase adjustment filters as well.
- KVRist
- 347 posts since 20 Apr, 2005 from Moscow, Russian Federation
Speaking of papers, Rane also has nice introductory/overview appnote for LR designs.
-
- KVRAF
- Topic Starter
- 7400 posts since 17 Feb, 2005
Works great
Except for some reason the lowest band is scrunching the next above band. I think there is some frequency scaling going on inside the core modules to prevent it from tuning too low. Also I has to adjust overall gain (on input) to get the spectrum peaks to input level.
Except for some reason the lowest band is scrunching the next above band. I think there is some frequency scaling going on inside the core modules to prevent it from tuning too low. Also I has to adjust overall gain (on input) to get the spectrum peaks to input level.