Bidirectional IIR filter

Post any examples or modules that you want to share here
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: Bidirectional IIR filter

Post by martinvicanek »

tester wrote:
KG_is_back wrote:If the filters should be complementary, there's no need to compute both of them. Calculate the lowpass and the highpass = input - lowpass ...You save almost 50%cpu (don't forget about the latency when subtracting form input).

Yep, I was always curious about that approach.
This simple subtraction works in this case where the two filters are truly complementary. In many cases, however, filters are only allpass-complementary, then
highpass = allpass - lowpass.
steph_tsf
Posts: 249
Joined: Sun Aug 15, 2010 10:26 pm

Re: Bidirectional IIR filter

Post by steph_tsf »

@KG_is_back : You are right about the delay! Attached is the subtractive version, and the "dumb" version. In the subtractive version I put a knob for slightly detuning (-10, +10) the delay, only for illustrating purpose. Leave the delay knob on 0 for applying the exact delay. While turning the delay knob, you can hear the highpass sound texture changing. Note how the delay tuning gets critical when Fc is high, say 3 kHz and above.
Attachments
bidirectional_IIR_xover_subtractive.fsm
(9.03 KiB) Downloaded 1530 times
bidirectional_IIR_xover.fsm
(9.51 KiB) Downloaded 1483 times
steph_tsf
Posts: 249
Joined: Sun Aug 15, 2010 10:26 pm

Re: Bidirectional IIR filter

Post by steph_tsf »

martinvicanek wrote:This simple subtraction works in this case where the two filters are truly complementary...
Strange assumption. Wrong context. There is only one filter to consider, the lowpass filter. Such lowpass filter is now phase linear thanks to the bidirectional IIR filtering technique. When applying the subtractive scheme, of course with the correct delay (equal to the buffersize), you'll always get the complementary highpass. In our case the delay is a digital delay. As consequence, the lowpass + higpass sum equals unity (in magnitude, and in phase). The global phase doesn't get distorted. It's that simple!

People get confused about "delay compensated" and "phase compensated" crossovers. Especially in "subtractive" implementations. There are reasons for that.

Jan 1986 Elektor published a subtractive crossover basing on a quad 1st-order highpass (resulting in a very soft 4th-order), featuring a phase compensated (allpass filter acting as pure phase shifter for emulating the highpass phase) subtractor delivering the lowpass. As result, the global phase gets distorted. Not better, not worse than a plain Linkwitz-Riley.

Sept 1987 Elektor published a subtractive crossover using a double 2nd-order Butterworth lowpass (resulting in a classic LR 4th-order), featuring a phase compensated (allpass filter acting as pure phase shifter for emulating the lowpass phase) subtractor delivering the highpass. As result, the global phase gets distorted. Not better, not worse than a plain 4th-order Linkwitz-Riley. Elektor paved the way for confusing "delay compensated" with "phase compensated". Elektor presented such circuit like it got inspirited by the "delay compensated Lipshitz-Vanderkooy" crossover presented at the AES in 1981 "A Family of Linear-Phase Crossover Networks of High Slope Derived by Time Delay". The Elektor audience got the impression that substituting delays by pure phase shifters was the proper way to go. Elektor made not clear enough that doing so, the global phase got distorted, just like a plain normal Linkwitz-Riley.
steph_tsf
Posts: 249
Joined: Sun Aug 15, 2010 10:26 pm

Re: Bidirectional IIR filter

Post by steph_tsf »

People may not like the double 2nd-order Butterworth lowpass filter.
People may prefer a lowpass filter guaranteeing no preshoot and no ringing.

bidir IIR LR xover (500).png
bidir IIR LR xover (500).png (68.65 KiB) Viewed 34024 times

How to implement a 4th-order Bessel lowpass, using the bidirectional IIR filtering?
Is there an IIR filter implementing the square root of a 4th-order Bessel lowpass?
Square root, because when executed "forward" then "reverse", it should equal a 4th-order Bessel.
Any advice welcome.
Last edited by steph_tsf on Mon May 12, 2014 4:39 pm, edited 3 times in total.
steph_tsf
Posts: 249
Joined: Sun Aug 15, 2010 10:26 pm

Re: Bidirectional IIR filter

Post by steph_tsf »

I made Q adjustable.
Almost no preshoot and ringing when Q set to 0.600
Real Fc = 1000 Hz when Fc knob set to 1230 Hz
Lowpass slope 4th-order like Linkwitz-Riley.
Highpass slope something like 2.5nd-order.
Looks okay. Makes me happy.

bidir IIR Q subtract xover (500).png
bidir IIR Q subtract xover (500).png (67.25 KiB) Viewed 34024 times
Attachments
bidirectional_IIR_xover _Q_subtractive.fsm
(9.22 KiB) Downloaded 1496 times
Last edited by steph_tsf on Mon May 12, 2014 7:40 pm, edited 4 times in total.
steph_tsf
Posts: 249
Joined: Sun Aug 15, 2010 10:26 pm

Re: Bidirectional IIR filter

Post by steph_tsf »

I made Q adjustable, and added knobs for adding a thin amount of bandpass energy and highpass energy in the woofer signal.
Almost no preshoot and ringing when Q set to 0.600
Real Fc = 1000 Hz when Fc knob set to 878 Hz
Lowpass slope something like 2.5th-order in the audio band.
Highpass slope something like 3rd-order.
Looks great. Makes me even more happy.

bidir IIR QBH subtract xover (500).png
bidir IIR QBH subtract xover (500).png (66.56 KiB) Viewed 34024 times
Attachments
bidirectional_IIR_xover _QBH_subtractive.fsm
(9.73 KiB) Downloaded 1500 times
Last edited by steph_tsf on Mon May 12, 2014 7:43 pm, edited 3 times in total.
steph_tsf
Posts: 249
Joined: Sun Aug 15, 2010 10:26 pm

Re: Bidirectional IIR filter

Post by steph_tsf »

What makes me less happy, is the US5479922 bidirectional IIR patent.
In what countries can I sell audio crossovers relying on the bidirectional IIR technique?

US5479922 bidirectional IIR (patent) (500).png
US5479922 bidirectional IIR (patent) (500).png (114.68 KiB) Viewed 34023 times
User avatar
TheAudiophileDutchman
Posts: 46
Joined: Tue Jul 13, 2010 1:36 pm
Location: Apeldoorn, The Netherlands

Re: Bidirectional IIR filter

Post by TheAudiophileDutchman »

Would this legal event make you more happy then? :D

14 maart 2000
FP Expired due to failure to pay maintenance fee
Effective date: 20000102
T A D - since 2005
steph_tsf
Posts: 249
Joined: Sun Aug 15, 2010 10:26 pm

Re: Bidirectional IIR filter

Post by steph_tsf »

Wow !
http://www.google.ca/patents/US5479922 adds value to the patent text, by listing the associated legal events.
http://www.freepatentsonline.com/5479922.html appears not to cover this.
steph_tsf
Posts: 249
Joined: Sun Aug 15, 2010 10:26 pm

Re: Bidirectional IIR filter

Post by steph_tsf »

For completeness, here is what's happening when specifying a 1st-order lowpass.
No preshoot and ringing, of course.
Lowpass slope 2nd-order as expected.
Highpass slope 2nd-order as expected.
This could possibly deliver excellent results with quality woofers exhibiting a well controlled high frequency roll-off, and quality tweeters able to handle power down to 1 kHz. Kind of audiophile approach maybe. This is worth trying in first place, especially when applying 128-tap FIR filters for linearizing both drivers, individually.

bidir IIR QLBH subtract xover (500).png
bidir IIR QLBH subtract xover (500).png (52.9 KiB) Viewed 34015 times

I'd like to experiment this using 32-bit audio on a ARM Cortex-M4 like STM32F4 (168 MHz - two I2S), or preferably a MIPS Microchip PIC32MZ (200 MHz - three I2S). For simplicity, a WM8580 could be hooked as I2S clock master, for featuring the S/PDIF-in and up to 6 channels of analog audio out. Can somebody help ?
Attachments
bidirectional_IIR_xover_QLBH_subtractive.fsm
(8.27 KiB) Downloaded 1354 times
Post Reply