IIR response equalisation - Home Theater Forum and Systems - HomeTheaterShack.com

Old 01-30-12, 10:32 PM Thread Starter
Shackster

Join Date: Jan 2012
Posts: 20
IIR response equalisation

I still have not fired up REW and maybe this has been answered before and is a newbie question...
So here goes nothing...

On the other thread I started about mic phase I wrote some Matlab routines that used non-linear regression in order to find the transfer function of a microphone. This actually worked really well in being able to fit filters to graphs (some data I have I had not shown in that thread as it was getting tiresome).

Provided part of a response is minimum phase (and I believe REW can already show this or work this out), then all the poles and zeros of any filter lie within the unit circle (for stability and causality).

Just to simplify things, suppose part of the speaker's response looks like a second order bandpass filter ...

H(s) = H0*( B*s )/(s^2 + B*s + w0^2)

this has a zero at s = 0 and two complex polse (within the unit circle). Now such responses are generally bad in audio as they resonate, apart from having addition gain at the centre frequency w0.

If we apply a corrective filter

G(s) = (s^2 + B*s + w0^2)/(H0*( B*s )) = H^-1(s)

the poles and zeros of H(s) and G(s) cancel out. End result should be neutral. G(s) is stable because its pole (s = 0) is within the unit circle. In fact the inverse transfer function of any minimum phase filter should be stable.

Any minumum phase transfer function can be represented as a combination of first and second order sections. Each of these can be inverted to find another function that negates it. So theoretically all minumum phase parts of a room loudspeaker response can be corrected if we can work out an expression for the speaker transfer function.

Since first and second order sections can be described from IIR filters, this means we should be able (in theory at least) to use REW to cancel out minimum phase response irregularities. We are not just restricted to FIR convolution as I had first thought.

So the question is ... is this already what REW is doing?
If so, it is not just correcting frequency response anomalies but is also correcting in time domain (a filter which has all its poles and zeros cancelled out has a perfect impulse response as well).

If REW is not already doing this, why not?
My gut feel is that it could be adapted to do so if it is not already.
Of course there will be problems like limited amplifier power, cone excursion, transfer function estimation accuracy etc which will limit utility ... main question is if REW tries to do this already and if there any major restrictions that make it a no-go to start off with.

Tsardoz

PS. I have some experience in biological system DSP but none in audio DSP.

EDIT - On rereading I notice it might seem I am claiming to be able to do all DRC. I am not saying this at all. Just the minimum phase bits. Even then it is a question rather than a statement.

Last edited by Tsardoz; 01-31-12 at 12:10 AM.
Tsardoz is offline

Old 01-31-12, 01:21 AM
HTS Senior Moderator

Russ

Join Date: May 2007
Location: The Inland NW, USA
Posts: 1,788
My System
Re: IIR response equalisation

Awesome question. You speak my language To answer your question directly, I do not know what algorithm that REW uses to flatten.

Also, I would venture to guess that the off-the-shelf DSPs people mostly use (minidsp and BFD) are a big limiting factor. E.g. I would suspect that the BFD has X number of second order IIR filters that it uses for its X number of PEQ bands, and that REW would try and solve for optimal coefficients based on so many of those.

Dampening poles near the unit circle in the frequency domain will indeed have a corresponding effect in the time domain... Applying some EQ and seeing the improvement in REWs waterfall plots is an easy way to observe that. A perfect impulse response is probably never acheived in the typical acoustic environment.

 My Setup SI HT18, Sealed, NU3000dsp "HT 2.0" Monitors (704D, XT25) Flatpack Computer Speakers (ND91-8) The In-Walls
fusseli is offline
Old 01-31-12, 06:02 AM Thread Starter
Shackster

Join Date: Jan 2012
Posts: 20
Re: IIR response equalisation

I have a MiniDSP board which can do up to 8 biquads. It seems you just tell it the coefficients

a0,a1,a2,b0,b1,b2 so you can make inverse filters presumably just by swapping the a's and b''s.

Whether you would really want to is another matter.
Tsardoz is offline
Old 01-31-12, 04:23 PM
REW Author

John

Join Date: Apr 2006
Location: UK
Posts: 6,302
Re: IIR response equalisation

Yes, the minimum phase part of a response can be corrected by simply inverting the transfer function. There are some difficulties though.

Firstly, the biquad sections do not happen to correspond to typical EQ filters, so until the advent of products like the MiniDSP there was no means of implementing the required EQ sections.

More significantly, the difficult part is determining the transfer function and factoring it. Factoring is not that difficult, as it amounts to finding the roots of large polynomials which is well understood, if far from trivial for high orders. Finding the system's transfer function from a measured response is difficult however, thanks largely to the contribution of noise in various forms which limits the signal's information content. Common approaches include ARMA (Auto Regressive Moving Average), LPC (Linear Predictive Coding), Padé Approximants, FDM (Filter Diagonalisation), DSD (Decimated Signal Diagonalisation) and others that can be broadly described as harmonic inversion. REW applies one such method in its "Find Resonances" function.

Having found a transfer function (not necessarily the transfer function thanks to the noise contribution) it is typically very high order, far too high to implement an inverse in a practical equaliser. There are methods to reduce the order of the transfer function whilst seeking to retain the essential characteristics of the signal, and if a method is successful then the order may be low enough to implement a decent inverse in a practical equaliser. The overall process is quite complicated though.

REW is designed to work with a variety of equaliser types, so its EQ functions take a different approach akin to that you used for your mic. The response is analysed against a target to identify areas where EQ filters should be applied, then the centre frequency, gain and Q settings of those filters are adjusted using a multi-variable stochastic optimisation routine that takes account of the control resolutions offered by the selected equaliser type.
JohnM is online now
Old 01-31-12, 06:49 PM Thread Starter
Shackster

Join Date: Jan 2012
Posts: 20
Re: IIR response equalisation

Thanks John.
Fortunately I have Matlab and the System Identifcation toolbox (and most others) so I can play around with this a bit. In my biological signal processing work I fitted low order transfer functions to arterial pressure pulses as they travelled down the radial artery, so have done a little of this type of thing.
I have read all the REW documentation now and must say I am very impressed.

EDIT:
Another one I could play around with, apart from non-linear regression and system identification, is optimization. eg. I can form the most complicated corrective filter that my dsp box can handle, setup a target function and just get it to minimise the difference between them (ie. minimise error). I can also set up various constraints to the solution, which can be hard with nonlinear regression. I don't know anything about the others so might just leave them alone.

Last edited by Tsardoz; 01-31-12 at 07:16 PM.
Tsardoz is offline
Old 08-18-12, 03:55 PM
Shackster
Andrea Tarasconi

Join Date: Jan 2012
Location: Italy
Posts: 48
My System
Re: IIR response equalisation

Hello JonhM,

I am beginning to use the EQ Filters feature and I have two quick questions:
1) Why the auto-eq option max freq range (for a full range loudspeaker set) can go from 10Hz to 10kHz only?
This is a very bad limitation because I have to manually set 4 or 5 filters to correct the 10 to 20kHz band.
2) Why, even if I set the starting point at 10Hz and I set the target response feasible, the auto-eq matching never goes below 20Hz? (Is it a bug?)
This enforce me to manually correct 1 or 2 filters in the 10-20Hz range.
3) Why in the Generic Equaliser mode the number of filters is anyway limited to 20?

Thank you.
Kind regards,
Andrea
AndreaT is offline
Old 08-19-12, 02:22 PM
REW Author

John

Join Date: Apr 2006
Location: UK
Posts: 6,302
Re: IIR response equalisation

1) In-room measurements have a natural roll-off at higher frequencies that is entirely normal, attempts to boost that would make the sound unnaturally bright and could damage tweeters. It is quite difficult to obtain reliable high frequency measurements and the results are very location specific (measurements a few cm away can be very different), EQ at high frequencies is often a bad idea. Because REW cannot know what a proper response level should be at high frequencies for any particular measurement it is safer for it not to make corrections there.

2) REW will only apply filters that are within the range of the selected equaliser, so make sure the equalise allows filters below 20Hz (e.g. the Generic EQ). REW will also not apply any boost below the lowest frequency at which the response drops (and remains) below the target. That is to prevent boosting a driver below its low frequency roll-off as it could result in damage. If that is not the situation you are experiencing attach an example measurement and the target and LF rolloff settings you are using.

3) There needs to be some limit, and it would be rare for EQ to need as many as 20 filters for a good result.
JohnM is online now
Old 08-20-12, 02:23 AM
Shackster
Andrea Tarasconi

Join Date: Jan 2012
Location: Italy
Posts: 48
My System
Re: IIR response equalisation

Dear JohnM,

you have been very clear.

Regarding my point 2), the behavior I have is due to "REW will also not apply any boost below the lowest frequency at which the response drops (and remains) below the target".
So, I will continue to correct this manually. No risk of damage of this 1400W sub driver unit.

Thanks a lot and kind regards,
Andrea.

Quote:
JohnM wrote: View Post
1) In-room measurements have a natural roll-off at higher frequencies that is entirely normal, attempts to boost that would make the sound unnaturally bright and could damage tweeters. It is quite difficult to obtain reliable high frequency measurements and the results are very location specific (measurements a few cm away can be very different), EQ at high frequencies is often a bad idea. Because REW cannot know what a proper response level should be at high frequencies for any particular measurement it is safer for it not to make corrections there.

2) REW will only apply filters that are within the range of the selected equaliser, so make sure the equalise allows filters below 20Hz (e.g. the Generic EQ). REW will also not apply any boost below the lowest frequency at which the response drops (and remains) below the target. That is to prevent boosting a driver below its low frequency roll-off as it could result in damage. If that is not the situation you are experiencing attach an example measurement and the target and LF rolloff settings you are using.

3) There needs to be some limit, and it would be rare for EQ to need as many as 20 filters for a good result.
AndreaT is offline

 Bookmarks

 Tags equalisation , iir , response

Message:
Options

## Register Now

Random Question
Random Question #2

User Name:
OR

## Log-in

Human Verification

In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.