Designing FIR Filters with Crossovers

for a 2-way Loudspeaker

The resulting FIR filters include the crossover responses and linearise the loudspeaker phase everywhere except at the loudspeaker’s low frequency roll-off. Measurements for this example can be downloaded below, and are taken from a 5″ coaxial loudspeaker. See all FIR Designer supported measurement import file formats.

This tutorial uses FIR Designer 1 (discontinued in 2017).
The latest version of FIR Designer has the same workflow plus significantly expanded functionality.

About measurements

Taking good loudspeaker measurements is difficult. Nearby objects and room acoustics all impact a loudspeaker measurement, and therefore how representative the measurement is of the loudspeaker itself. This example assumes that you are experienced in taking measurements, and that you understand the limitations of your measurement environment and are familiar with concepts including measurement gating/windowing, averaging and time alignment.

Accurate, representative measurements are very important when using the Auto Mag and Auto Phase features in FIR Designer. Inaccurate measurements can result in these automatic functions adjusting the loudspeaker’s magnitude and phase response in ways that measure well well for one specific location in the room only, and measure poorly and sound worse everywhere else.

When designing filters for multi-way loudspeakers, it is important to maintain the relative acoustic time delay between the drivers in the measurements, as this affects how the loudspeakers acoustically sum in the crossover frequency ranges. Most measurement software can remove the bulk acoustic and sound-card delay from a measurement with an “align to peak” or “auto delay” feature. Do this once, say for the highest frequency driver, then fix the delay for all measurements of all drivers.

Finally, when taking measurements with a Microsoft Windows PC, choose a sound-card that has ASIO drivers. Many Microsoft Windows MME/WDM sound-card drivers are notorious for having inconsistent latency, which can cause time offset errors between measurements.

Terms

  • LF : Low frequency
  • HF : High Frequency
  • LPF : Low pass filter
  • HPF : High pass filter

LF Driver Response

Figure 1
Figure 1

Start FIR Designer.

On the “Import” tab, click “Load.” Find and select the measurement file for the LF driver and press “Open.”

Uncheck “Normalise magnitude to max.” This may make the magnitude response – the blue line – disappear out of view.

Adjust the “Magnitude offset (dB)” value until the lower-frequency, flatter portion of the spectrum – indicated by the arrow – is at approximately 0 dB.

Here the offset value is -76 dB. Note this value for use later with the HF driver.

In the “Project” menu, select “Save” and save the project as “LF Filter”. (The *.fdp file extension is added automatically.) We will load this project file again later.

HF Driver Response

Figure 2
Figure 2

On the “Import” tab, click “Load.” Find and select the measurement file for the HF driver and press “Open.”

Uncheck “Normalise magnitude to max” and enter the “Magnitude offset (dB)” value, noted from the LF driver. Here the value is -76 dB. Using the same value for the LF and HF driver ensures that the relative levels of the two drivers are maintained.

Note here that the HF driver has a higher average magnitude, since it is more sensitive than the LF driver. This is typical of HF drivers.

In the “Project” menu, select “Save” and save the project as “HF Filter”. (The *.fdp file extension is added automatically.) We will load this project again later.

LF Crossover Target

Considering the LF and HF responses above, here we have chosen a crossover frequency of 2 kHz.

(Good loudspeaker design also takes into account other factors including the directivity of the drivers and their maximum level capabilities, but this is beyond the scope of this example.)

In the “Project” menu, select “New.”

Figure 3
Figure 3

Check “Direct Design.” The tabs will change to the three shown.

On the “Magnitude Design” tab, enable a filter and set it to a 4th order Linkwitz-Riley LPF with linear phase; as shown.

Figure 4
Figure 4

Make sure that the “Filter delay” and “Filter length” are long enough to ensure there is essentially no difference between the ideal and windowed filter. Here the defaults of 200 and 400 samples are fine since the sides of the filter, in the upper plot, are well below -100 dB. Also check that the “before windowing” and “after windowing” lines in the lower plot are identical.

On the “Export” tab, in the “Format” drop-down, select “FIR Designer target file,” click “Save” and save the file as “LF Target”. (The file extension *.fdt is added automatically.)

In the “Project” menu, select “Save” and save the project as “LF Target”. (The file extension *.fdp is added automatically.)

HF Crossover Target

Figure 5
Figure 5

Select the “Magnitude Design” tab and change the filter type to Linkwitz-Riley HPF.

Figure 6
Figure 6

Again, make sure that the “Filter delay” and “Filter length” are long enough to ensure there is essentially no difference between the ideal and windowed filter.

On the “Export” tab, in the “Format” drop-down, select “FIR Designer target file,” click “Save” and save the file as “HF Target”. (The file extension *.fdt is added automatically.)

In the “Project” menu, select “Save” and save the project as “HF Target”. (The file extension *.fdp is added automatically.)

LF FIR Filter Design

In the “Project” menu, select “Load” and open the previously saved project file “LF Filter.fdp”.

Tutorial2_Fig07
Figure 7

On the “Target” tab, select “Design + File.” Here a target response is created by combining the upper plot EQ curve with the target file response from the lower plot.

Click “Load” and select the target file “LF Target.fdt”.

The setting “Use Magnitude only” tells FIR Designer to ignore the phase of the loaded target response. Here the phase of the target file doesn’t matter since the target file is already linear-phase.

Figure 8
Figure 8

Select the “Magnitude Adjustment” tab.

The light blue line in the upper plot is the inverted loudspeaker magnitude and with the target response added. The aim here is to use the magnitude filter prototypes, on the left, to create a composite filter magnitude filter – the green line – that approximately matches the light blue line.

Here two LPF filters are used to approximately match the light blue line. More filters could be used, however here we will primarily match the response near 4 kHz, and use the “Auto Mag” tab later to address all the ripples between 200 Hz and 4 kHz.

Figure 9
Figure 9

Select the “Phase Adjustment” tab.

The light red line in the upper plot is the loudspeaker phase, after filtering from previous tabs, then inverted and with the target phase added. (In this example, the target phase is 0 degrees or flat.) The aim here is to use the phase filter prototypes, on the left, to create a composite phase filter – the green line – that approximately matches the light red line.

Here one 4th order filter is used to move the phase, near 300 Hz, to 0 degrees – shown by the arrow. We will use the “Auto Phase” tab later to address the phase ripples between 300 Hz and approximately 10 kHz.

Figure 10
Figure 10

Select the “Auto Mag” tab.

Again, the light blue line in the upper plot is the loudspeaker magnitude after filtering from the previous tabs, then inverted and with the target response added. Here FIR Designer can calculate a magnitude filter to automatic follow the light blue line within a chosen frequency range.

Enable the 1st auto mag band between 200 Hz and 4 kHz, as shown. 4 kHz is chosen to be just sufficiently into the LPF stop band – down to -30 dB – to ensure a good summation with the HF driver around the crossover frequency.

Figure 11
Figure 11

Select the “Auto Phase” tab.

Again, the light red line in the upper plot is the loudspeaker phase, after filtering from all previous tabs, then inverted and with the target phase added. (In this example, the target phase is 0 degrees or flat.) Here FIR Designer can calculate a phase filter to automatically follow the light red line within a chosen frequency range.

Enable the auto phase band between 600 Hz and 6 kHz, as shown. 6 kHz is chosen to be just sufficiently into the LPF stop band – down to just below -30 dB – to ensure a good phase match with the HF driver around the crossover frequency.

Figure 12
Figure 12

Select the “Export” tab.

The ideal filter needs to be truncated and windowed to make it practically usable in a processor. To minimise the error between the ideal and windowed filter, adjust the “Filter delay” and “Filter length” so that the ends, in the upper plot, are below approximately -60 dB.

Here we have chosen a “Filter delay” of 150 samples and a Filter length of 500 samples.

The lower plot shows both the ideal and the windowed filter. To see the fine difference between the two, look at the “Total Error” on the previous tabs.

Figure 13
Figure 13

The greatest difference or error will always be at the lower frequency end of the filter; here near 300 Hz – indicated by the arrow. Shortening the “Filter delay” and “Filter length” will increase the error, but shortening may be necessary to fit the filter into some processors.

On the “Export” tab, in the “Format” drop-down, select the desired output file format, click “Save” and save the file as “LF Filter”. (The appropriate file extension is added automatically.) Here we have chosen “Binary file (32 bit, float)” which is used by MiniDSP processors.

In the “Project” menu, select “Save” and save the project as “LF Filter”. (The file extension *.fdp is added automatically.) The save will prompt to confirm overwriting of the previously created project file.

HF FIR Filter Design

In the “Project” menu, select “Load” and open the previously saved project file “HF Filter.fdp”.

Figure 14
Figure 14

On the “Target” tab, select “Design + File.” Here a target response is created by combining the upper plot EQ curve with the target file response from the lower plot.

Click “Load” and select the target file “HF Target.fdt”.

Figure 15
Figure 15

Select the “Magnitude Adjustment” tab.

Here a HPF and a shelf filter are used to approximately match the light blue line. More filters could be used, however here we will primarily match the response at between near 900 Hz and near 16 KHz, and use the “Auto Mag” tab later to address all the ripples in between.

Figure 16
Figure 16

Select the “Phase Adjustment” tab.

Here two 4th order filters are used to move the phase, near 900 Hz and near 9 kHz, to 0 degrees. We will use the “Auto Phase” tab later to address all the phase ripples in between.

This particular HF driver has a notch at approximately 11 kHz, possibly due to breakup or possibly due to it’s particular coaxial mounting. Since this notch could move in frequency, and since it’s quite narrow and not very audible, attempts to flatten it with filtering could sound worse than leaving it alone. Here we will leave it alone.

Figure 17
Figure 17

Select the “Auto Mag” tab.

Since we don’t want to correct the ~11 kHz notch, enable two auto mag bands – one each side of the notch – as shown. The lower limit of 900 Hz is chosen to be just sufficiently into the HPF stop band – down to -30 dB – to ensure good summation with the LF driver around the crossover frequency.

Figure 18
Figure 18

Select the “Auto Phase tab.

Enable the auto phase band between 700 Hz and 9 kHz, as shown.

As mentioned previously, we won’t attempt to correct the magnitude and phase at the notch frequency.

Figure 19
Figure 19

Select the “Export” tab.

To maintain time alignment with the LF driver, it is important to use the same “Filter delay” as used for the LF driver – here 150 samples. Since HF frequencies have shorter wavelengths, HF filtering generally can be done with shorter FIR filters. However it is recommended to start with the LF driver first, to determine the shortest “Filter delay” that will work for both drivers.

In the “Format” drop-down, select the desired output file format, click “Save” and save the file as “HF Filter”. (The appropriate file extension is added automatically.) Here we have chosen “Binary file (32 bit, float)” which is used by MiniDSP processors.

In the “Project” menu, select “Save” and save the project as “HF Filter”. (The file extension *.fdp is added automatically.) The save will prompt to confirm overwriting of the previously created project file.

Figure 20
Figure 20

To see the LF performance of the filter, check “View range: -100 to 20 dB.” Lengthening the “Filter delay” and “Filter length” will make the windowed filter better match the ideal filter at low frequencies.

HF Series Capacitor

In active loudspeaker designs, it is common to use a series capacitor to provide both DC blocking and some LF protection to the HF driver.

FIR Designer includes an “IIR Filters” tab where IIR filters that are used inline – analog or digital – can be entered. FIR Designer takes these into consideration in the FIR creation process, so that the combination of IIR and FIR filters gives the desired, filtered loudspeaker response. The “IIR Filters” tab also includes a simple 1st order series capacitor calculator.

Tutorial2_Fig21
Figure 21

Select the “IIR Filters” tab.

In the “Series Capacitor Calculator,” enter the HF driver impedance and either a capacitor value or frequency, and the calculator calculates the frequency or capacitance. Here for an 8 ohm driver and 5 uF capacitor, the 1st order HPF cutoff is approximately 4 kHz.

Enable the first IIR filter and set the filter to a 1st order Butterworth HPF at ~4 kHz. Note how the 1st order filter brings the loudspeaker magnitude response closer to the target, mostly in the 800 Hz to 2 kHz range.

Figure 22
Figure 22

Select the “Magnitude Adjustment” tab.

With the IIR filter enabled, the HPF magnitude filter can be lowered in frequency so that the filtered response matches the target at approximately 900 Hz.

Tutorial2_Fig23
Figure 23

Select the “Phase Adjustment” tab.

Now with the IIR filter in enabled, the loudspeaker phase has moved further away from the target. Here we add an additional 4th order filter to help bring the filtered phase back to 0 deg. (Each 4th order phase filter has limits of ±90 degrees.) Also, note that less phase shift is needed at 9 kHz to bring the response close to 0 deg.

Figure 24
Figure 24

Select the “Auto Mag” tab.

Similar to previously, we use two auto mag bands, however the “Min Freq” of the lower band has moved to 800 Hz.

Figure 25
Figure 25

Select the “Auto Phase” tab.

Change the “Min Freq” of the band to 820 Hz so that it starts approximately where the phase is already 0 deg.

Figure 26
Figure 26

Select the “Export” tab.

In the “Format” drop-down, select the desired output file format, click “Save” and save the file as “HF Filter w IIR”. (The appropriate file extension is added automatically.) Here we have chosen “Binary file (32 bit, float)” which is used by MiniDSP processors.

In the “Project” menu, select “Save” and save the project as “HF Filter w IIR”. (The file extension *.fdp is added automatically.)

Further comments

This example uses the default  “Design sample rate” of 48 kHz however the sample rate can be changed at any time. Imported measurements and target responses are stored in the their native sample rate and resampled to the “Design sample rate.”

The magnitude response or “voicing” of the loudspeaker can be adjusted by enabling additional linear-phase EQ filters on the “Magnitude Design” tab for both the HF and LF target projects, re-exporting the target filter files, then re-importing the target files into the LF and HF filter projects.

The phase rotation, in the low frequency roll-off around 50 Hz, can also be linearised using a combination of filters on the “Phase Adjustment” tab (see Figure 9) and the “Auto Phase” tab (see Figure 11). This will, however, require larger “Filter length” and “Filter delay” settings.