Splitting Bands with Linkwitz-Riley

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

... ZDF/trapezoidal/TPT ...

More strictly speaking for AP = In - 2*BP it has to be just a BLT bandpass (i.e. having G@FN=0). The way you get to the topology (i.e. whether it was TPT, *-transform, direct-discrete-design or whatever) is irrelevant in this case (but yes, TPT filters would fit the best so far).

Post

Yes, you are right. Though for the optimised LR you'll need SVF or some other multimode topology. And thinking back I think I was referring to multi mode designs, but it probably wasn't very clear.

Annoyingly no one here seems to be able to agree on the term for topology matched BLT designs.

ZDF - marketing hype
TPT - not specific enough, could equally apply to Euler or other designs
Trapezoidal integration - also can be used for direct form BLT designs

That's just a sample of the objections, so sometimes I just list them all in the hope that everyone has at least one naming convention they can live with :D

Post

matt42 wrote:Yes, you are right. Though for the optimised LR you'll need SVF or some other multimode topology. And thinking back I think I was referring to multi mode designs, but probably wasn't very clear.
Even a direct-form filter can give you "multi-mode" if you put the (two sets of) zeroes after the poles.
ZDF - marketing hype
TPT - not specific enough, could equally apply to Euler or other designs
Trapezoidal integration - also can be used for direct form BLT designs
Direct forms don't really quality as trapezoidal integration except as optimisations of the LTI case, but the real problem with the terminology here (as I see it) is that what you really want is "trapezoidal integration with BLT pre-warping" and typing that out every time is not exactly all that convenient, yet personally I fail to see the point of trying to coin yet another acronym. After all, even "TPT" is really "yet another acronym" since it essentially means the exact same thing as ZDF which was coined first (marketing hype or not).

Post

matt42 wrote:Yes, you are right. Though for the optimised LR you'll need SVF or some other multimode topology. And thinking back I think I was referring to multi mode designs, but it probably wasn't very clear.

Annoyingly no one here seems to be able to agree on the term for topology matched BLT designs.

ZDF - marketing hype
TPT - not specific enough, could equally apply to Euler or other designs
Trapezoidal integration - also can be used for direct form BLT designs

That's just a sample of the objections, so sometimes I just list them all in the hope that everyone has at least one naming convention they can live with :D
My personal opinion:

- ZDF is anyway used exclusively to describe BLT TPT. As it is commonly recognized and hardly ever misunderstood I see little reason not to use it.

- TPT as a term is most commonly mentioned in connection with BLT. So, even though BLT TPT is more specific, again, BLT/trapezoidal can be understood implicity, unless "explicitly overridden"

- I'd say saying trapezoidal integration to describe direct forms is somewhat of a misnomer, since this doesn't really mean integration, but rather something which is only equivalent to it and only in the LTI case.

Thus, in my opinion all of ZDF, TPT and trapezoidal integration work as terms. We could however further differentiate them:

- TPT can be understood as a more specific description of the application method being graphical, putting the stress on the topology
- respectively trapezoidal integration could describe purely algebraic way, putting the stress on the equation form
- ZDF, according to its de-facto usage, could be a term combining both of the above

Bottom line:
as ZDF seems to be most recognized term, marketing hype or not, it's good enough as a label. After all, it's just a label, no need to turn the choice of a label into something big and start a big campaign of changing the already accepted terminology, as long as the label serves its purpose.

PS. And in the specific case of L-R, theoretically speaking we don't need ZDF, any BLT should do, including direct forms. Practically, direct forms may be less desired due to precision issues or if good time-varying behavior is needed, but that's a separate point.

Post

Technically we can go with `ap = 2*(lp - hp) - in`,
and there the LP/HP don't have to be BLT at all (the requirement will be only lp_g@anyf + hp_g@anyf = 1 so that the result remains to be the desired allpass). But that's also another big story.

Post

Max M. wrote:Technically we can go with `ap = 2*(lp - hp) - in`,
and there the LP/HP don't have to be BLT at all (the requirement will be only lp_g@anyf + hp_g@anyf = 1 so that the result remains to be the desired allpass). But that's also another big story.
Please forgive me if I'm mistaken, but if you want a phase-coherent cross-over (ie. all the bands have the same phase everywhere) then as far as I can tell you're stuck with Linkwitz-Riley in continuous time and since trapezoidal method is the only integration rule that properly preserves this property for discrete time, you don't really get much of a choice.

Post

JCJR wrote: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.
A more symmetric way would be to use a multimode 2nd-order with LP and HP outputs and send them through 2nd-order LP and HP respectively.

Post

Z1202 wrote:
JCJR wrote: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.
A more symmetric way would be to use a multimode 2nd-order with LP and HP outputs and send them through 2nd-order LP and HP respectively.
Actually the way I'd normally do it for 4th order would be to use a multimode to get LP and AP, then put the LP through a second LP stage and then use AP-LP to get the HP. This only takes 2 biquads (+ a few multiply adds for the 2nd output from the first stage).

Post

mystran wrote:
Z1202 wrote:
JCJR wrote: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.
A more symmetric way would be to use a multimode 2nd-order with LP and HP outputs and send them through 2nd-order LP and HP respectively.
Actually the way I'd normally do it for 4th order would be to use a multimode to get LP and AP, then put the LP through a second LP stage and then use AP-LP to get the HP. This only takes 2 biquads (+ a few multiply adds for the 2nd output from the first stage).
Cheat! :D :D :D
Nice one :tu:

Post

Z1202 wrote:
mystran wrote:
Z1202 wrote:
JCJR wrote: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.
A more symmetric way would be to use a multimode 2nd-order with LP and HP outputs and send them through 2nd-order LP and HP respectively.
Actually the way I'd normally do it for 4th order would be to use a multimode to get LP and AP, then put the LP through a second LP stage and then use AP-LP to get the HP. This only takes 2 biquads (+ a few multiply adds for the 2nd output from the first stage).
Cheat! :D :D :D
Nice one :tu:
There's more "cheating" opportunities for multi-way cross-overs if you delay the all-pass compensations to the recombination phase:

split input into band0 and input1 with xover0
split input1 into band1 and input2 with xover1
split input2 into band2 and input3 with xover2
split input3 into band3 and band4 with xover3
.. and so on

Now you got 5 bands which you can process, then recombine as follows:

band4 + band3 + allpass3(band2 + allpass2(band1 + allpass1(band0)))

So we just compensated a 5 way system with total of 3 allpass filters. Note that this means that the signals won't have equal phase when they are processed, but depending on what you are trying to do this might not really matter.

ps: if you pipeline the whole thing together with the processing, you also don't need to even store more than 3 signals (even if you block process the filters): the current band, the recombination sum and the remaining unprocessed input.

Post

mystran wrote:Please forgive me if I'm mistaken, but if you want a phase-coherent cross-over (ie. all the bands have the same phase everywhere) then as far as I can tell you're stuck with Linkwitz-Riley in continuous time and since trapezoidal method is the only integration rule that properly preserves this property for discrete time, you don't really get much of a choice.
You actually made me doubt for a few minutes, but no, BLT is not the only choice in this case.
Here's 2nd-order xover using a naive-LP (made of two 1st-order naive-lps and the corresponding allpass) - for the sake of simplicity:

Code: Select all

w = 2*pi*f/fs;
k = 2 - cos(w) - sqrt((2 - cos(w))^2 - 1);

// nlp1 (direct form coeffs):
b = [(1-k) 0]; a = [1 -k];

// nlp2:
b = [0 (1-k)]; a = [1 -k]; // <- note the non-min-phase b

// allpass
b = [-k 1]; a = [1 -k];

// and finally the crossover:
LP = nlp1*nlp2
HP = AP - LP
Plot for f/fs = 6k/48k.

All three filters (HP, LP and their sum) have the same phase response, thus the crossover still meets the key LR requirement.
The trick is just in using non-minphase zeros for HP/LP (thus it should be applicable for any N > 1 order filters). And I think the same will work for higher-order xover units too (I'm not sure about odd orders though - needs testing).

---
(Hmm, that was interesting question - in fact this made me to really revise some of my old stereotypes about phase properties of non-BLT filters... Thanks!)

Post

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


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.

Thanks Matt, and Max M and mystran.and z1202

I coded up vadim's zdf SVF awhile ago and tested it some, seemed well-behaved but haven't been very busy with audio coding for a few months. It is exciting/interesting that a 4th order LR crossover element could be done with two 2nd order SVF, exploiting the allpass and lopass outputs of the first of the two lopass-path SVFs.

Well actually the second 2nd order lopass filter wouldn't need to be state-variable. Any BLT 2nd order lopass ought to do for the second lowpass in the 4th order linkwitz riley lowpass path. But I like finding well-behaved code and using it whenever appropriate, and the ZDF SVF doesn't seem particularly a CPU hog. So if I got interested/motivated in much further coding, would be inclined to use ZDF SVF object wherever possible, just as years ago I used RBJ cookbook filters wherever possible, just for simplicity. IMO the older chamberlin SVF would be too dull a tool to work correctly.

Post

JCJR wrote:Well actually the second 2nd order lopass filter wouldn't need to be state-variable.
Neither needs the first one. SVF topology is essentially the same of direct form II (or transposed direct form II, I always forget which is which), except that you use unit delays in place of integrators. You can always treat the FIR part of direct form I or II as modal mixture (just the modes do not make the same nice sense in isolation as in SVF). Thus you pick a direct form version which has the FIR part at the output and then you could use several FIR parts sharing the same IIR input.

Not that I recommend to use direct forms, but just for the sake of fairness :D

Post

Max M. wrote:Here's 2nd-order xover using a naive-LP (made of two 1st-order naive-lps and the corresponding allpass) - for the sake of simplicity:
If we apply inverse BLT to this we will obtain an HS-HP crossover (high-shelving - highpass) :D

Post

Here is a bit of thread drift about SVFs in case interesting. When I was checking Max M's suggestion about making a 4th order linkwitz riley crossover with only two-SVF, was wanting to verify that the SVF allpass would have exactly the same phase plot as the two series lopass filters. "Trust but verify" :) For instance if the two series lopass filters are 0 degrees at DC trending toward -360 degrees at nyquist, but for some odd reason the allpass might be something weird like +90 degrees at DC and -270 degrees at nyquist, then the [allpass - lowpass] trick would fail. The SVF allpass would need to either be identical phase plot to the 4th order lopass, or 180 degrees away so that a simple inversion would make the trick work.

Maybe a long time ago I knew some details and forgot them. Can't say what is new vs maybe re-learned. Here is the most-typical generic 3 opamp analog SVF
Image
The input to the circuit is inverted and it uses two inverting integrators. The first bandpass integrator acheives negative feedback by routing the inverted integrator to the positive input of the hipass opamp.
Image
Maybe that is one reason Mr. Oberheim used such an "odd" design in his SEM filter which was earlier discussed? The input is still inverted but it uses non-inverting integrators, achieving first-integrator bandpass negative feedback wired to the negative input of the hipass opamp.
Image
Image
A JOS paper shows IMO a much-improved implementation. The input is non-inverting. The integrators are non-inverting, with expected negative feedback from both integrators. The listed phase plot, so far as I can understand, Allpass = Input - 2 * UnityGainBandpass, should give the same phase plot as the two series 2nd order butterworth lopass filters.
Image
Vadim's VA Filter Design Book SVF appears to have the same "idealized" topology as shown in the JOS paper, so I assume the phase plot would also be about the same.

An "idealized" analog SVF could be made using non-inverting input and non-inverting integrators, at the expense of more parts. Perhaps in most analog SVF applications, it would not be worth the extra parts count, because in the majority of cases it wouldn't matter if phase gets flipped here or there in the total circuit flow.

For example if we make an analog SVF in order to mix hipass and lopass for an elliptical filter, then it wouldn't matter that the bandpass is inverted with respect to the hipass and lopass, and the inverting mixing opamp would un-do the inversion caused by the SVF, and in many cases inversion wouldn't matter anyway.

Just in some cases maybe an analog designer was intentionally exploiting an oddball analog SVF property that a young DSP coder might miss if he just assumes all the old SVF's are as "logical" as a modern idealized DSP version?

I saw contradictory descriptions of the polarity and phase of the outputs of that first "typical analog SVF" circuit, from sources which are usually reliable. Meaning that old reliable sources could sometimes mis-remember or discribe things wrong. I'd make my own guesses as to the polarity and phase of a circuit, but in the presence of "contradictory authorities" would probably want to actually test the circuit and find out. :)

Post Reply

Return to “DSP and Plugin Development”