Removing Loudspeaker Group Delay using reverse-IIR filtering

... about the only times i see constant delay considered part of group delay, is when signal processing folks are discussing it. When it's audio folks, group delay is nearly universally equated with frequency dependent delay only.
That's a good point. When discussing "pure" signal processing, one is generally looking at an isolated component and studying its particular response. In an audio system, pure delays abound, due simply to the inherent distances between elements. That, in itself, justifies removal of those pure delays. Again, as long as everybody understands the basic assumptions, there is no problem.
 
If the hpf and lpf are fully complementary, I would expect a 96kHz sampling rate to rather easily provide sufficient time alignment precision to eliminate the mag and phase ripple around 500Hz xover.
I had casually set the HPF specification roughly by hand instead of setting it to the LPF delay @ 500Hz. It could be better, rather easily.
And yes, latency or rather constant time, is totally different from group delay imo. (my rational given in immediately previous post to gberchin)

The 1ms delay in impulse peaks in both our techniques, is constant time latency, not group delay.
Group delay is similar in our two techniques, simply because both have flattened 🙂! phase to zero degrees (after removing constant delay.)
I was tallking about the scientific group delay not the layman kind. Latency is not immediately available from the transfer as it is hardware dependent. Latency is more like the period from when the first sample enters to when the first sample leaves the equipment.
For the purpose of a simple complementary xover where the FIR filter is handing a relatively low Q task, not much resolution is needed and is why on 48 taps at 4kHz worked for a relatively shallow LR24 @ 500Hz.
And is also why I keep asking everyone to choose a lower xover point, say 100Hz or below, and better a higher order too, to demonstrate their proposed technique. 500Hz and up, shallow slope is just too easy to achieve without significant latency.

IIR tail precision?? Cut the dang post-ringing tail off ! Go FIR !!
I use 500Hz just so that I do not have to wait for a long time every time I run my script. And to me the concept is more important than the exact numbers and filters are scalable anyway.
 
By the way, I don't recall seeing any mention of "phase delay". Phase delay is -phi/omega, units of (radians per radian/second) = seconds. With a pure delay, phase delay is the (negative of the) slope of the phase curve, and in a linear phase system, group delay and phase delay are equal.
 
Yes, and it is easily verified by equating both:

1727930160614.png

which describes a linear phase filter. The value of K is negative for causality.
 
@mark100 here's a 100Hz version (16384 pts) of the same idea. The GD for the summed output is 6ms (vs 4.5ms for the LPF). It maybe possible to reduce this to ~5ms but I haven't tried to do so because the difference is small.

LPF (blue): LR4 100Hz (IIR) followed by 2 x APF (IIR) at 380Hz Q = 1.9.
HPF (red) : LR4 100Hz linear phase FIR with matched delay of ~ 6ms to match LPF at 100Hz.
Summed output (black), impulse attached for interested parties, pls rename to *.wav after downloading.

1727969354995.png
 

Attachments

Thanks for showing a lower frequency example, at 100Hz.
That looks very good to me, flat mag and phase, with a respectable low constant delay of about 5.9ms. Nice work.

Here's your file loaded as a measurement, into my measurement & sim software.
1727972100977.png




Here's my FIR linear-phase version of the same 100Hz LR24
Sides summed together, with a constant delay / latency of about 4.25ms

1727972408976.png


Here's both sides:

1727972661478.png


FWIW, It takes only 3-4 minutes to generate the FIR complementary lin-phase low-pass and high-pass set, at any frequency at any order.
So far, It's really hard to see why I'd want to do anything else.

For sub EQ work, where FIR might not have the needed frequency resolution, I simply use IIR min-phase EQ's to level magnitude as preconditioning to the FIR xover.
For any driver section above the sub, FIR's frequency resolution has been more than sufficient to embed min-phase flattening EQs, along with linear phase xovers.

Since both xover and leveling EQ's are generated automatically via acoustic target matching, workflow is incredibly quick, and very accurate.

For fun the other day, I timed setting up a 4-way from scratch....including taking raw measurements. Had to set polarities, levels, delays, and build FIR file for all four channels. Measure each channels' processed acoustic output. Measure summed 4-way acoustic output. Entire process took less than 1/2 hour.

That done, I could change xover frequencies and/or orders in about 5-10 minutes, depending on how many xovers were being altered.
I just can't see making xovers any harder than that...
 
Dear mark100, as I said above, you could copy any FIR filter I show with a similar filter with a similar impulse but my examples above use only IIR for the lower pass, avoiding a long FIR filter and related issues. In other words, you're just making an FIR copy of an IIR-based crossover.

There're people on this forum who use inexpensive / old DSPs that restrict the FIR length to a certain no. of taps. In such cases, it is possible to use an IIR+APF for the LPF, and thereby redirect the limited / valuable FIR resources towards where they could be put to proper use (HPF).
 
For those who don't have DSPs with FIR capability, here's a simple matched delay subtractive (MDS) filter based on the same IIR+APF low pass, as mentioned earlier by phase_accurate. The exact MDS delay value used here is 5.4ms. This value gives a somewhat 4th order transition upto 20Hz, also giving better LF suppression.

Note that this is an IIR only crossover though it is capable of linear phase and the computational delays are negligible.

1728038648605.png
 
There're people on this forum who use inexpensive / old DSPs that restrict the FIR length to a certain no. of taps. In such cases, it is possible to use an IIR+APF for the LPF, and thereby redirect the limited / valuable FIR resources towards where they could be put to proper use (HPF).
FIR resources need not be limited / valuable. Implementing FIR is not $ expensive at all.
Just requires some learning (and for sure, it's a lot less learning than working with IIR + APF, ime).

JRiver for example, running on anything (even a Raspi), easily allows tap counts far exceeding anything we've been discussing, or that anyone could ever use. (like > 100,000 taps per channel).
There are a number of other similar very low cost alternatives.
 
Note that this is an IIR only crossover though it is capable of linear phase and the computational delays are negligible.
@newvirus2008 , forgive me, but I've only been following this thread in a cursory fashion. Can you elaborate on how you accomplished this? What was your MDS lowpass filter, and what was the allpass filter that you added? Does the allpass filter just extend the linear-phase portion of the lowpass, or does it do something else that escaped my attention?
 
Did anyone try going "multi-rate" to shorten the FIR? Suppose... if you do 3-way with 250 & 2500Hz, you may do 2500 QMF first, then resample f<2500Hz as 1/6, filter 250Hz, and resample 6/1.
What do you think: would PR sub-band analysis-synthesis make any sense?
Is it worth trying block-based fast convolution?
 
@gberchin Yes, just that, nothing special. the allpass occurs only within the lowpass section to linearise the phase to about 5x the cutoff freq of 100Hz. The HPF is then obtained by MDS operation from a delay of 5.4ms. The following gives an idea....

Code:
[G1,F] = grpdelay(u,1,N,Fs);                    % LPF DC group delay
G1 = G1/Fs;
GD = G1(1);
                                      
target_phase = -1.2*2*pi*GD*F;              % 1.2x gives the pseudo 4th order slope
HPF = exp(i*target_phase) - LPF;            % MDS HPF              

.......
 
Last edited:
  • Like
Reactions: Gill.T
That looks very good to me, flat mag and phase, with a respectable low constant delay of about 5.9ms. Nice work.

Here's my FIR linear-phase version of the same 100Hz LR24
Sides summed together, with a constant delay / latency of about 4.25ms

A latency of 4,25 is not an issue, but if it gets more than 15-20ms it probably will, at least for live performances. If I'd like to compensate the GD of a horn (etc) subwoofer, a steep low cut at 35-40Hz (ie your LR24) would result in which latency?