• Welcome to ASR. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

LinFIR – DSP Software for FIR/IIR Filter Design and Speaker Correction

Hi Arnaud

Very nice improvements. Yesterday I spent a couple of hours attempting to replicate my filter design in your tool and compare it against the Marani AEQ tool.

After getting a better understanding, I imported a mid-range driver SPL and precise phase and started step 1 with the “correction filer” to flatten the FR over the band 200-8000Hz (intended band is 400-2800Hz) - once I got the hang of gain and attenuation controls it was relatively easy to get the driver response flat(ish), but still some significant ripples remained.

On the phase, I could not equalize that to zero degrees >500Hz.
Then I tried step 2 and chopped off this response with LR24 at 400Hz and LR48 at 2800Hz.

Q1. Is there a way of seeing how the filter implements the LR high and low pass targets? How close the actual response will be to the roll-off curves? In much the same way as the correction filter allows you to observe how close it comes to a flat line?

Q2. The second thing I noticed that when I applied the crossover filter (either one) which I expected to have no phase shift, the phase of the driver did in fact change significantly. If the LR filter is indeed zero phase, then what could be causing the change?

Q3. Is there a way to flatten the phase and remove residual phase response? I did also notice that the phase response curve just starts at 200Hz and the phase response below that is not shown

My last observation is that your tool creates more attenuation in the low frequency tail, the response keeps falling down to -70dB at ~100Hz whereas than the Marani AEQ software always wants to bring the response “up” due to AEQ action, and I need to add IIR PEQ filters to drag it down.

I am hoping to get some time in the next day or so to make a frequency response measurement in my MIR 260E to verify that the design and implementation are close. Is there a way to export the tabular frequency response of the final filter? That way I can do an accurate comparison. BTW I ma using 512 taps at 48kHz

Best regards
 
Hi Arnaud,

I have a follow-up question about extracting the phase from the driver imported impulse response or after conversion from imported FR back to the impulse response.

How does your software determine the position of the FFT window? The precise location is needed to remove the time of flight (excess phase) to leave only the phase response of the driver.

In many dual channel MLS measurement systems, the measurement channel uses an assumed identical reference channel, to remove things like the frequency response irregularities of the test amplifier, etc. However, if I am not mistaken the band-limited impulse (sinc X) is convolved with the actual measured response of the driver and thus in the measurement channel, as part of the impulse response of the driver, it contains “pre-ringing” which is clearly not coming from the minimum phase driver response. You can see this in many software measurement systems (using chirp or MLS) This introduces an ambiguity of where the FFT window should be placed to precisely remove the excess phase, due to the pre-ringing. To check that the impulse capture window is located at the correct time, a check of the FFT measured phase can be done and compared against the HBT-derived phase. The software that I use is Soundeasy and it does both the HBT check and also the inverse HBT check from the phase response, pretty much guaranteeing the correct impulse window location and thus precise extraction of the minimum phase of the driver. Often the location is not precisely at the maximum rise of the impulse. So my measured data of my driver contains precise phase response in the FRD values, but when it is imported in to LINFIR, the FR data is resampled and a new impulse response created, along with the new phase response based upon LINFIR determining it location of the Impulse window - e.g click the remove time of flight button, to remove excess phase.

So my question is how does LINFIR determine the precise start time of the impulse window to remove the excess phase and no more? This only really matters if precise phase compensation is needed, which in my case is what I am trying to achieve.

Best regards
 
So my question is how does LINFIR determine the precise start time of the impulse window to remove the excess phase and no more? This only really matters if precise phase compensation is needed, which in my case is what I am trying to achieve.

Loudspeaker drivers are minimum phase devices. Starting from measured magnitude response, minimum phase can be calculated. Measured phase and minimum phase can be compared in terms of group delay. Any wideband delay-offset between measured phase and minimum phase is excess delay and can be removed prior to compensation. Real-world measurement issues may impose major complications on this process.

If measured phase is ignored completely, only using minimum phase calculated from magnitude respose, any delay offsets that may exist between individual drivers cannot be compensated. In many cases this will be an acceptable approximation which ignores excess phase by design.

If one measures individual drivers to generated bandpass filters including x-over between multiple drivers, relative delay/phase has to be taken into account. This can be done in joint measurement analysis by synchronized removal of excess delay between individual drivers and requires measurements taken with constant delay.
Another option would be to handle all driver responses as minimum phase and determine any excess delay differences in an independent step. Compensation of relative delays between drivers may afterwards be done by bulk delay in DSP.

In real-world measurements, limited signal quality especially below the loudspeaker's lower cutoff frequency and any kinds of reflections in the measurement may screw up results. Any strategies applied to remove measurement error would be most important for me as these can help to avoid major errors in phase compensation.
 
In active DSP designs the crossover design is much easier. First flatten the amplitude and phase of each driver, then handle to time offset directly by DSP delay. In my case, I am using KEF UniQ with drivers located physically in the same place, so the delay needed is the difference between FIR delays of the tweeter and midrange filters. Two ways I check for time alignment -i) with a pulse signal and oscilloscope to ensure that tweeter and midrange pulses occur at precisely the same time and ii) by MLS measurement with one of the driver polarites inverted and tune for the deepest null - very effective. This one is preferred as it is a wide-band signal and the acoustic centers of each driver move a bit with frequency and the wide-band signal takes the average. Richard Heyser’s papers give the basic theory.

I have had a practical problem of measuring the mid-range driver part of the UniQ. The Impulse response window size is limited to around 7.3msec, to avoid the ground bounce (loudspeaker outside - ground is the only reflector), but that doesn't allow the LF cut-off to be correctly obtained. So, one might expect that a near field measurement would be a solution, but placement of the microphone at the center is not correct as the tweeter and phase plug are there. Also, the near field phase and far field phases differ, so the near field phase is not usable.
So, if I widen the impulse window out to say 15msec, small but significant ripples are introduced in to the frequency response - but the measurement correctly resolves the LF slope of the driver = good! However, using the HBT/IHBT process to find the minimum phase, now introduces errors, because of the reflections which are not minimum phase. So to your point ^^ yes reflections can screw up the results, depending upon the duration /magnitude of the reflections.

Any suggestions?
 
Near field will also not show the baffle step correctly. I would try ground plane measurement and potentially stitch magnitude response with gated measurement in the upper frequency range. Then do filters based on minimum phase from magnitude (only) of both drivers. Last step would be time alignment as you described. Notch method also works with swept sine measurement. Gated measurement should also show x-over frequency with sufficient detail to take delay from phase difference.
 
Thanks very much. Each solution is a compromise! Near field means modeling baffle step correctly. If each driver is zero phase at crossover frequency then its just time alignment.

Anyway, my next step is to add more absorber on the ground to reduce the ground reflections -at 300Hz it means a lot of absorber!

Thank you for your suggestions. If all else fails I will go with ground plane - assuming I can find a space big enough!
 
Hi Arnaud

Very nice improvements. Yesterday I spent a couple of hours attempting to replicate my filter design in your tool and compare it against the Marani AEQ tool.

After getting a better understanding, I imported a mid-range driver SPL and precise phase and started step 1 with the “correction filer” to flatten the FR over the band 200-8000Hz (intended band is 400-2800Hz) - once I got the hang of gain and attenuation controls it was relatively easy to get the driver response flat(ish), but still some significant ripples remained.

On the phase, I could not equalize that to zero degrees >500Hz.
Then I tried step 2 and chopped off this response with LR24 at 400Hz and LR48 at 2800Hz.

Q1. Is there a way of seeing how the filter implements the LR high and low pass targets? How close the actual response will be to the roll-off curves? In much the same way as the correction filter allows you to observe how close it comes to a flat line?

Q2. The second thing I noticed that when I applied the crossover filter (either one) which I expected to have no phase shift, the phase of the driver did in fact change significantly. If the LR filter is indeed zero phase, then what could be causing the change?

Q3. Is there a way to flatten the phase and remove residual phase response? I did also notice that the phase response curve just starts at 200Hz and the phase response below that is not shown

My last observation is that your tool creates more attenuation in the low frequency tail, the response keeps falling down to -70dB at ~100Hz whereas than the Marani AEQ software always wants to bring the response “up” due to AEQ action, and I need to add IIR PEQ filters to drag it down.

I am hoping to get some time in the next day or so to make a frequency response measurement in my MIR 260E to verify that the design and implementation are close. Is there a way to export the tabular frequency response of the final filter? That way I can do an accurate comparison. BTW I ma using 512 taps at 48kHz

Best regards
Hello,

I'll try to answer all of your questions.

Q1: There is no dedicated overlay to visualise LR, Butterworth of Bessel FIR equivalents, but you can compare with what you obtain using the IIR implementation of those filters.

Q2: If you mean "linear phase" FIR filters, those can still modify the phase in multiple ways. First with the additional delay which translates to a pure linear slope component, and second with out of band response. With high attenuation, the magnitude will become really small and in some cases it can reach 0. This breaks phase continuity (you are trying to measure the angle of a vector of norm 0).
When using the "Remove time of flight" phase option, you remove the linear phase component from the displayed responses. But be aware that when multiple drivers are enabled, LinFIR removes the common bulk delay, so you can still see slope changes for a specific driver when introducing FIR delay.

Q3: I'm not sure to understand what you mean by "residual phase response". The truncation you are seing is intended, it is a mechanism that removes everything under -20dB when a crossover is applied, otherwise graphs would be hard to read... You can disable that in the settings.
Hi Arnaud,

I have a follow-up question about extracting the phase from the driver imported impulse response or after conversion from imported FR back to the impulse response.

How does your software determine the position of the FFT window? The precise location is needed to remove the time of flight (excess phase) to leave only the phase response of the driver.

In many dual channel MLS measurement systems, the measurement channel uses an assumed identical reference channel, to remove things like the frequency response irregularities of the test amplifier, etc. However, if I am not mistaken the band-limited impulse (sinc X) is convolved with the actual measured response of the driver and thus in the measurement channel, as part of the impulse response of the driver, it contains “pre-ringing” which is clearly not coming from the minimum phase driver response. You can see this in many software measurement systems (using chirp or MLS) This introduces an ambiguity of where the FFT window should be placed to precisely remove the excess phase, due to the pre-ringing. To check that the impulse capture window is located at the correct time, a check of the FFT measured phase can be done and compared against the HBT-derived phase. The software that I use is Soundeasy and it does both the HBT check and also the inverse HBT check from the phase response, pretty much guaranteeing the correct impulse window location and thus precise extraction of the minimum phase of the driver. Often the location is not precisely at the maximum rise of the impulse. So my measured data of my driver contains precise phase response in the FRD values, but when it is imported in to LINFIR, the FR data is resampled and a new impulse response created, along with the new phase response based upon LINFIR determining it location of the Impulse window - e.g click the remove time of flight button, to remove excess phase.

So my question is how does LINFIR determine the precise start time of the impulse window to remove the excess phase and no more? This only really matters if precise phase compensation is needed, which in my case is what I am trying to achieve.

Best regards
There is no FFT window. The whole signal is processed through an FFT, and after that it's easy to estimate the mean linear slope. How the linear phase is removed actually depends on the processing applied. There is three methods employed:
- fitting the linear phase component
- Computing it from the delay at the main peak
- ... or at the rising transient of the impulse response

I personally do not use FRD files. They lack a lot of data points and when converting them to impulse responses, a lot of artefacts can appear. And you often lose time reference.
That being said, when importing them in LinFIR, magnitude and phase are fitted to guess the missing data, and DC and Nyquist extensions can be selected as constant or roll off extrapolations.
In the majority of the cases, pre-ringing caused by abrupt sweep start imposes a minimum delay to avoid truncation (which leads to magnitude and phase errors). You can always use the "minimum phase" conversion button but... It will transform the "linear phase" frequency cut into a causal filter and induce phase rotations. Also, a driver is not purely minimum phase. Diffraction or break-up modes typically introduce non-minimum phase components in the response.
 
Otherwise, I've released LinFIR 1.3.1.

I've introduced a mechanism to overlay the target curve when using the auto EQ feature, and the auto EQ algorithm has been improved. In some cases, wide (low Q) filters could mask residual error because of the way new filters are initialised in the optimisation algorithm, resulting in uncorrected parts of the response.
 
Hi Arnaud,

Thanks very much for your detailed reply. On the topic of excess phase removal, my question was not very clear.

Your text

There is no FFT window. The whole signal is processed through an FFT, and after that it's easy to estimate the mean linear slope. How the linear phase is removed actually depends on the processing applied. There is three methods employed:
- fitting the linear phase component
- Computing it from the delay at the main peak
- ... or at the rising transient of the impulse response

Let’s forget about FRD-IR conversion and assume we have a impulse response from a raw driver, measured with a band-limited measurement system. Inspecting the impulse response we see signs of pre-ringing - how can that be? Since the raw driver is a minimum-phase device. The pre-ringing is a measurement artifact of band -limited channel and sharp roll-off of the anti-aliasing filter ( thinking here of sound-cards, but applicable to any measurement channel). The measured response contains the pre-ringing baked in and it was this I was referring to when it comes to deciding where the impulse starts, for any method ^^ of excess phase extraction.

Bohdan Raczybski the designer of soundeasy has been working on this topic for a while and using the HBT and its inverse (IHBT) to generate error functions that are used to precisely place the FFT window (aka start of the impulse). One of his papers is here

Earlier in the year I did some pulse delay measurements using and narrow pulse and oscilloscope and confirmed that his HBT/IHBT routine and direct time of flight agree closely. Ironically, the start of the peak of the impulse is often not where the precise minimum phase can be extracted - I don't know exactly why that is, because it is counterintuitive, but the pre-ringing is one plausible cause.

Practically this only matters if high precision phase measurements/compensation are being sought. Plus, it only matters if each individual driver is been measured, because in the case of multiple drivers the absolute phases are not important - only that the signals from each driver arrive at the same time.

Anyway, in your three methods, does your software combine all 3 methods to determine the excess phase?

I’d be interested in your further thoughts on this topic when you have some time.

Meanwhile I am creating for test filters with LINFIR and enjoying it. Its going to be a great product!

Best regards

Brian
 
Hi Brian,

I do not use this method, because it is wrong on multiple levels.

First, it is assumed that a transducer is purely minimum phase, which is not true. Diffraction and break-up modes, for instance, introduce non-minimum phase components into the phase response. This translates into phase rotations around the frequencies where they occur and breaks Kramers-Kronig relations: the minimum phase reconstruction cannot be superimposed onto the measured phase once the bulk delay is removed.

Second, and this is the worst part, the majority of measurements do not start at f=0 (DC) for obvious reasons. More than anti-aliasing filters, this is the main cause of visible pre-ringing on measured impulse responses. This is not an artifact; it is a direct consequence of not starting the sweep at DC. You can see it as a form of sinc filter applied to the sweep. When you compute the minimum phase response from the measured magnitude, you transform this "linear phase" cutoff into a minimum phase one. Since the cutoff slope is extremely steep, you get a massive amount of phase rotations around the cutoff frequency, which totally destroys any chance of estimating the time of flight.

More generally, wherever the magnitude reaches zero on the real frequency axis, the phase becomes undefined. The phase vector has zero norm and its angle loses meaning. This is precisely what happens at the low-frequency cutoff of any measurement that does not start at DC, and it makes any attempt at phase reconstruction fundamentally ill-posed in that region. Without a DC reference, you can't say much about the expected time reference.

In LinFIR, the following three methods are used depending on the context:
- The rising edge time reference is only used with the delay compensation option to remove the time of flight and push the IR close to t=0.
- The linear trend is used for phase smoothing (the linear component is removed and added back after curve smoothing).
- The peak position is used for phase correction and phase display without time of flight.

It is mainly empirical, but it is robust.
 
Hi Arnwald,

First of all my sincere apologies for getting your name wrong in multiple posts.

I have observed the erratic phase response in the region where the cone breaks up on my UNIQ driver - outside of its intended passband in operation but visible on a Wideband measurements - its an area that measured and HBT phase do not overlap, but in other parts of the frequency response they do. Incidentely, I was making polar response measurements vs frequency and in the breakup region the polar response collapses.

When you mention “DC” what low frequencies are you thinking the measurement should start? 5Hz or even less? Does the measurement system in your software meet all the criteria you mentioned above? I haven’t used it yet, but am now very curious to try it and compare results with different measurement systems (ARTA, Soundeasy and Marani AEQ).

On the diffraction issue, add non-minimum phase components there is no way that I can think of to avoid it. Going to near field the SPL magnitude is proportional to far field but the phase is not correct. Adding the baffle step and diffraction with modelled values is less appealing to me too. Splicing the near and far fields and then using HBT to get the phase from the joined responses is close (I’ve done it) but getting the correct slope to DC is a bit trial and error and one can never be sure its correct - so it tills the overall phase curve significantly.

Anyway, thank you again for your comments on this - I am still learning.

I’ll report back if/when I have something new.

Best regards

Brian
 
In fact you were spelling it correctly, Arnwald in a pseudonym. :)

By DC, I mean 0 Hz, literally. But I bypassed all that trouble by just using the estimated delay from the IR peak. The plots share a common time reference when phases are displayed without time of flight, so it doesn't matter.

Where having the right reference can be important is when correcting phase, but here again, removing the bulk delay from the IR peak just works: the phase curve nicely collapses around 0°, leaving only excess phase.
But then again... air temperature can sufficiently affect the speed of sound to cause phase deviations in high frequencies. E.g., measuring at 20°C vs. 30°C at 2 meters, you get enough variation to produce a full 360° phase rotation at 9975 Hz. Or to put it another way, at 9975 Hz, the wave will have traveled a full wavelength faster in warmer air. And above that frequency, it will be worse...
 
LinFIR is dedicated to filter creation only.

... mainly focused on filter design and visualization

...primarily intended to shape the response of speakers based on anechoic measurements (though it definitely works for room correction too)
I need to do the per-speaker filters separately from the DRC, perhaps even using separate standalone processing nodes.

It seems obvious to me that the former comes first

then the crossover filtering

then the overall DRC.

Right?

wrt to your project, where does timing delays / phase alignment tuning, fit into the workflow?

I saw it as integral to crossovers filter design only, but now I'm not sure.

Is LinFIR like Gsonic Reference, in that doing the DRC part is Stereo only, the crossovers and other bass management, anechoic per-speaker stuff all must be settled

then system-wide DRC functions as a separate "final layer"?
 
In fact you were spelling it correctly, Arnwald in a pseudonym. :)

By DC, I mean 0 Hz, literally. But I bypassed all that trouble by just using the estimated delay from the IR peak. The plots share a common time reference when phases are displayed without time of flight, so it doesn't matter.

Where having the right reference can be important is when correcting phase, but here again, removing the bulk delay from the IR peak just works: the phase curve nicely collapses around 0°, leaving only excess phase.
But then again... air temperature can sufficiently affect the speed of sound to cause phase deviations in high frequencies. E.g., measuring at 20°C vs. 30°C at 2 meters, you get enough variation to produce a full 360° phase rotation at 9975 Hz. Or to put it another way, at 9975 Hz, the wave will have traveled a full wavelength faster in warmer air. And above that frequency, it will be worse...
Agreed, on the air temp topic. Some measurement software provides the means to input the actual propagation velocity (e.g soundeasy). There is also time delay distortion - the acoustic center moves with frequency.
 
I need to do the per-speaker filters separately from the DRC, perhaps even using separate standalone processing nodes.

It seems obvious to me that the former comes first

then the crossover filtering

then the overall DRC.

Right?

wrt to your project, where does timing delays / phase alignment tuning, fit into the workflow?

I saw it as integral to crossovers filter design only, but now I'm not sure.

Is LinFIR like Gsonic Reference, in that doing the DRC part is Stereo only, the crossovers and other bass management, anechoic per-speaker stuff all must be settled

then system-wide DRC functions as a separate "final layer"?
Indeed, I think it's best to design "room agnostic" speakers, as they will be more predictable. And It's the beauty of LTI systems, they can be decomposed into separate/cascaded problems.

Time alignment is done using this section. First apply your correction and crossover filters to each drivers and then tweak delay and gain. :)

Capture d’écran 2026-04-24 à 09.37.03.png


In LinFIR, room correction is handled through another type of project. It is designed to average each spatial measurement to mitigate room modes, reflections and listening position effects. It is mono only, but you can measure both left and right in the same project to average them or treat the two channels independently with two sets of measurements (and two distinct projects).
 
Hi Arnaud

I see that you have a microphone calibration capability in the measurement section. How does this FR response adjust the drivers impulse response?

Also, I am having some difficulty when importing .wav impulse files and have followed the naming convention correctly - any thoughts. I am using ASCHI text vlaues for the impulse response from my measuring system - is there anyway to scale them? Because the amplitude is display spl 70dB - I’d like to normalize to 0dB at peak.

Many thanks
 
I have a multi-driver passive bookshelf pair as main front L/R that I want to HPF and reinforce with a single-driver "MBM coupler" pair going down to maybe 60Hz

The crossover will likely be somewhere between 150-300Hz

Should "per speaker" correction be tested on the multi-way speakers?

I'm asking generally, not just wrt LinFIR...

Or just EQ my single-driver enclosures before starting on testing different crossovers?
 
Hi Arnaud

I see that you have a microphone calibration capability in the measurement section. How does this FR response adjust the drivers impulse response?

Also, I am having some difficulty when importing .wav impulse files and have followed the naming convention correctly - any thoughts. I am using ASCHI text vlaues for the impulse response from my measuring system - is there anyway to scale them? Because the amplitude is display spl 70dB - I’d like to normalize to 0dB at peak.

Many thanks
The microphone calibration file is transformed into a minimum phase FIR filter and applied to the IR when selected in the IR management window. It affects both magnitude and phase (it is physically accurate).

What king of troubles are you having? Text formatting can be a bit tricky depending on the OS. Can you try importing a WAV file?

No scaling is planned at the moment, you will have to do that with another software.

I have a multi-driver passive bookshelf pair as main front L/R that I want to HPF and reinforce with a single-driver "MBM coupler" pair going down to maybe 60Hz

The crossover will likely be somewhere between 150-300Hz

Should "per speaker" correction be tested on the multi-way speakers?

I'm asking generally, not just wrt LinFIR...

Or just EQ my single-driver enclosures before starting on testing different crossovers?
If you can measure and correct speakers independently, I think it's best to proceed that way. It is generally better to correct drivers before crossing them as crossover regions would be cleaner.
 
Arnwald,

First, thanks for the software. Amazing how much is available for free.

Is it possible to correct reach drivers response to match the crossover slope with LinFIR given that i can provide per driver measurements (not anechoic, though, just on-axis at about 1-1.5m)?

Or is what i describe basically the main workflow for the crossover use-case (as opposed to room correction scenario)?
 
Back
Top Bottom