Audio FIR Filtering – Part 2
A Guide to Fundamental FIR Filter Concepts & Applications in Loudspeakers
Although not a new technology, manufacturers are increasingly including FIR (finite impulse response) filtering in loudspeaker processors and DSP based amplifiers due to the significant increase in performance-versus-cost of microprocessors and DSP hardware.
In part 1 we introduced basic digital audio concepts, the FIR filter and compared IIR & FIR filters in terms of EQ performance and impulse response length. Here in part 2, we continue the comparison considering computational complexity and the key benefits of FIR filters.
1. Computational Complexity
In the introduction we mentioned that FIR filters are more computationally costly than IIR filters. Let’s consider some of the simple IIR and FIR filters shown above. When estimating and comparing computational costs, we generally look at the mathematical operations – multiplications and additions. We assume that a processor can calculate a “multiply” and an “add” effectively in the same operation; and therefore we can ignore the additions and just count and compare the multiplications.
The 1st order IIR filter above has 3 coefficients which need to be multiplied with the audio samples, and so we estimate the filter to take approximately 3 x the sample rate operations per second. The FIR filter has N coefficients (where N is the filter length) and so we estimate the FIR filter to take N x the sample rate operations per second.
The following table compares the filters from above.
We’ve seen in the examples how approximately 40 taps or more are needed for the FIR filters to approximate the IIR filters, and the table shows that this comes at the computational cost of 8 times or 13.3 times that of the IIR.
Typical Speaker Processor output Channel
As at the writing of this article, a common high-end speaker processor has approximately 24 IIR biquads for high-pass (HP), low-pass (LP), shelf and parametric filters, and 2048 taps of FIR. The following table compares the computational cost of both.
2. FIR Filter Benefits
If FIR filtering is so computationally costly, what are its advantages? There are two primary benefits:
- independent control of magnitude and phase, and
- more detailed equalisation (including easier filter creation from a desired frequency response).
Let’s explore each of these further.
Independent Control of Magnitude and Phase
With most IIR filters, the phase response is inherently linked with the magnitude response. (One exception is the IIR all-pass filter.) A huge benefit of FIR filtering is the ability to manipulate magnitude and phase independently. Following are four FIR filter examples. Each have the same magnitude response but very different phase responses.
Example : Minimum-phase FIR Filter
Previously we showed how both IIR and FIR filters use sample delays (as well as coefficients) to achieve their intended changes in the frequency response. A minimum-phase filter effects EQ whilst adding the least amount of delay to the audio signal. (This is one of the reasons long FIR filter based EQ in PA systems is typically minimum-phase.) A characteristic of a minimum-phase filter is that its impulse response has larger coefficients at or near the start of the impulse response. The following two plots shows a minimum phase FIR filter that effects a HP near 100 Hz and some EQ. Whilst the FIR filter length is 42.7 ms, the effective delay is negligible.
Example : Linear-phase FIR Filter
The following two plots show a FIR filter with the same magnitude response but with a flat or linear phase. The bulk delay through the filter is equivalent to the peak location of the filter: here 1024 samples or 21.3 ms.
Example : Maximum-phase FIR Filter
The following two plots show a FIR filter with the same magnitude response but with maximum-phase; this is the opposite or inverse phase of the minimum-phase filter above. The impulse response is the time reverse of the minimum-phase impulse response and so the bulk delay through the filter is approximately the length of the filter; 42.7 ms.
Example : Mixed-phase FIR Filter
Finally we have an arbitrary phase or mixed-phase FIR filter with the same frequency response. The bulk delay through the filter is approximately the location of the filter peak; here ~1480 samples or 30.4 ms. Where the peak is placed depends on the desired characteristics of the FIR filter and how those characteristics can be achieved within the tap length limit; here 2048 taps. To better understand this, take a look at some of the FIR Designer tutorials.
Why do we care about mixed-phase behaviour? So we can push a loudspeaker’s phase to where we want it!
Why is Independent Phase Control Useful?
A loudspeaker driver can be thought of as a minimum-phase filter (when comparing the acoustic output with the electrical signal into the driver). When using minimum-phase EQ to bring a loudspeaker driver’s magnitude response closer to “flat,” the phase of the loudspeaker driver also flattens and moves closer to linear phase (at least within the audible pass-band of the loudspeaker).
However in a typical multi-way loudspeaker, the IIR HP and LP crossover filters (as well as polarity, delay and acoustic filters, like ports) all add frequency-varying extra phase. Because of this extra phase, a multi-way loudspeaker can be thought of as a minimum phase system PLUS some all-pass filters.
Since minimum-phase EQ generally doesn’t affect the all-pass behaviour, we can use FIR filtering to move the phase of the loudspeaker to where we want it.
Arbitrary phase manipulation has many applications including;
- Phase linearising a loudspeaker. (Despite the apparent improvement in the loudspeaker impulse response, there’s some debate as to whether this gives a perceptual improvement in loudspeaker performance.)
- Matching the phase (and magnitude) of loudspeakers within product lines, and across different models in installs, so that they are easier to tune in clusters and to array together.
- Manipulating individual loudspeakers in array processing (for audience overage optimisation) and in beam steering.
- Crossover optimisation to improve frequency response consistency within the coverage angle of a multi-way loudspeaker.
More Detailed Equalisation (& Easier Filter Creation)
Using a loudspeaker measurement, we can create a frequency response (magnitude and phase) that will push the loudspeaker towards a desired target response. Because of the inherent relationship between the impulse response and frequency response, FIR filter coefficients can be generated from a desired frequency response fairly easily using DFT (or FFT) methods. The target response can be anything including:
- pink noise flat
- pink noise flat with slight HF roll-off (such as Cinema X-Curve)
- flat (linear) phase
- the magnitude and phase response of another loudspeaker
- the magnitude and phase response required from array processing calculations
The following four plots show an on-axis measurement of a commercial 12″ + horn 2-way cabinet and a 2048 tap FIR filter created to push the cabinet’s response to have a relatively flat magnitude response (with a slight HF roll-off) and flat phase in the pass-band.
Designing EQ from Measurements and Measurement Averaging
Attempting to EQ fine structure and ripples in loudspeaker responses can be problematic. A loudspeaker’s response varies with microphone and loudspeaker position, with level & temperature, and even over time. Fine EQ designed from a single measurement might result in the loudspeaker sounding better for the conditions and position of the measurement, but is likely to make the loudspeaker sound worse at other positions and at other levels etc. Great care must be taken to ensure the measurement is relevant and useful under all the conditions the loudspeaker will be used in – for example within the whole of the intended coverage area. Averaging measurements from multiple locations is one way to create a measurement that can be used as a starting point for effective, fine EQ.
3. FIR Filtering for Subwoofers?
The following plots show an example of using a FIR filter to both EQ a subwoofer and unwrap the low-frequency phase (from the cabinet and the high-pass IIR used to protect against over-displacement).
Filtering at very low frequencies requires very long filters; here 5000 taps with an IR peak delay of 3500 taps or 72.9ms. (This is simply an example of what a FIR filter can do and it’s yet to be tested whether the reduction in low-frequency group delay improves the perceived sub impact. With such a large delay, it’s probably not useful for live applications but may be useful in cinema and home theatre applications.)
4. Designing & Loading Custom FIR Filters
The growing awareness of the benefits and flexibility of FIR filtering in audio, combined with the ever-increasing performance-versus-cost of microprocessors and DSPs, has resulted in increasing numbers of audio products with user-accessible FIR filtering blocks. These products enable loudspeaker designers, installers, system operators and DIY’ers to load custom FIR filters. See a list of FIR-capable processors, amplifiers & software products.
Software tools like FIR Designer* enable the design and simulation of FIR based EQ and mixed IIR+FIR presets/tunings for loudspeakers and systems, from loudspeaker or system measurements. Comprehensive measurement averaging functionality for spatial and level averaging is also included.
* All the FIR filter examples and plots in this document were generated with FIR Designer.