I'm starting this thread to talk about an interesting and new method for "removing" group delay from a
continuous audio signal using reverse-IIR filtering.
Background: When you perform "analog style" filtering on a signal, that filter does not output all frequencies at the same time. Instead, frequencies emerge from the filter at different times. This is a consequence of what the filter is doing in the frequency domain (e.g. to the frequency response) - the filter automatically produces non-linear phase changes to the output signal. The result is a distortion of the time-domain waveform, because the appearance in time of various passed frequency components has been altered compared to the input. This sort of phase-domain distortion does not in any way change the magnitude of the frequency component (the frequency response) but the signal in the time domain may look badly distorted. This effect is called by different names, including phase distortion and group delay distortion. When the distortion grows large enough, it is possible to perceive a change to the "tone" of the signal. At lower levels it becomes imperceptable/inaudible. in general, the steeper the filter the worse the group delay distortion and this puts some limits on how steep of a filter we can use for a loudspeaker crossover. With FIR filtering, the situation is different. Phase and amplitude of the filter are independent of each other and this means it is possible to choose the phase to be linear (meaning the group delay is flat). Until now, FIR processing was essentially (to the best of my knowledge) the only practical way to implement a filter with a linear phase response.
More Background: Forward-Backward IIR processing. Someone realized that if you had some finite quantity of sampled audio you could process it first in the normal "forward" direction, and then also in the "backwards" direction. The filter's magnitude changes are applied twice. But the changes in the phase of the signal are exactly reversed, undone, and set back to zero in the "reverse" pass of the filter. What is happening is that the time shift of a given frequency that occurs in the forward direction is exactly equal to the time shft from the reverse pass, but these are opposite in their time "direction" and so they cancel. The result is zero phase distortion, zilch, nada! Let's do it says the crowd. Ah, but implementing this is not so simple. In the forward pass the ringing tail of the signal requires some time to "die down" This extends the duration of the original signal by the length of the tail. This tail must also be processed in the reverse pass in order for it to be brought back in time to its original "place". But if you have a continuous signal, things get tricky. There have been attempts at overlap-and-add methods to process chunks of a continuous signal and then sort of stitch them together but this typically leads to end effects and other problems, and the algorithm is a bit messy.
To the rescue and something that I belive is completely novel is the work by
Martin Vicanek that is described in his whitepaper "
A New Reverse IIR Filtering Algorithm":
https://www.vicanek.de/articles/ReverseIIR.pdf
I will not get into the gory details of the algorithm too much here. However, in the whitepaper Martin describes a way to take the "Infinite Impulse Response" of the IIR filter, truncate it to make it an FIR response, and then reverse the FIR as blocks in order to reverse the poles of the filter. It's frankly some brilliant work that completely eliminates the need for block processing. The only inputs to the algorithm are previous INPUT samples. There is no longer the feedback from output samples because of the re-formulation of the IIR as an FIR (which is then reversed). This allows for continuous "forward only" processing of the audio signal, and this can go on indefinitely. Best of all, the number of operations required for the processing is much less than the equivalent FIR and latency is much less than reverse-IIR block processing methods.
So, how does this help with loudspeaker group delay? While reading Martin's whitepaper I recalled that the group delay from the summed outputs of an Nth order crossover (the sum of the lowpass and highpass filters that make up the crossover) is the same as the group delay from an all-pass filter of order N/2. An example of this is a 4th order Linkwitz-Riley crossover, which is constructed from two second order Butterworth filter (each having the same pole frequency and Q=0.707) run in series. The LR4 has the EXACT same group delay as a second order allpass filter with the same Fc and Q. So, to make a linear phase LR4 crossover we can implement the allpass response, "in reverse" via the RIIR filter, upstream of the crossover to "pre-distort" the phase of the signal so that after it passes through the LR4 and undergoes an "in air" summation the phase remains unchanged.
The applicability of this technique is very broad. This is because we only need to find the group delay response of the loudspeaker that results from the crossover filters and other sources of delay, construct approximately the same group delay response using only all-pass filters, and then apply those all-pass filters in reverse using the RIIR filter. It doesn't matter what order the crossover may be or what the source of the group delay, as long as you can model or measure it you can cancel most or all of it depending on how close a match you can get via allpass filters. My recent effort to do some group delaey audibility testing, as well as what has been repoted in the literature about group delay, indicates that group delay does not need to be zero but only below some threshold to remain inaudible because human hearing is just not all that sensitive to it. But what (to me) is interesting as someone interested in new frontiers in crossover design, is that filters that previous had too high of a group delay response because they were "very steep" can now be corrected to have as low of a group delay as you wish. This starts to blur the lines between IIR and FIR processing and what each type can accompllish, and I find that pretty interesting stuff.
So, are there any downsides? Well, not really but there is a consequence to the RIIR algorithm: latency. When I described how the algorithm works, above, I mentioned that the IIR impulse response is truncated to become an FIR filter. This truncation introduces error because you are at some point setting the remaining part of the impulse "tail" to zero. This is a source of error or noise in the output signal. The more of the tail you retain, the lower is the added "noise" signal. Luckily Martin provides a way to determine how much of the tail needs to be retained when given some signal to noise ratio that is desired. Also, because the tails from poles located at lower frequencies last longer than for higher frequencies, RIIR filtering for filters with lower pole frequencies requires increasing latency. But luckily the tail decays exponentially, and so the latency is not too severe. In a test trial I ran a 1kHz 2nd order allpass as an RIIR filter. This required 128 samples of latency at 96kHz, which is a latency of 1.33 milliseconds. It's a small price to pay indeed.
I have created LADSPA plugins that implement the RIIR algorithm for first and second order allpass filters. These can be used for phase and group delay equalization and linearization. As of 27SEPT2024 these are available for download at my LADSPA page:
http://audio.claub.net/LADSPA-plugins.html
I will post some follow up information including some more specific examples soon. For now I thought I would put this out there to start a discussion and raise awareness of this processing algorithm.