Matching a IIR filter to a higher order FIR filter

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

Well, I heard that it is possible to build a IIR filter matching the frequency/phase response of a higher order FIR filter, say for a real-time emulation of a cabinet impulse response. The problem is to match a polynomial in z (FIR) to a rational polynomial (IIR) with lower order. This seems complicated to me. How this could be achieved? Can someone point me to the right direction?

Post

Doing it on the fly.. not sure.. but if you want to model a cabinet (as you say) then get the freq plot, then design a bunch of cascaded and parallel IIRs to match it as closely as you can.

HTH
DSP
Image

Post

Within posihfopit I have a similar thing runing, the user "draw" a desired frequency response and the plugin "calculates" the Biquad-IIR coefficients. I have read several papers about how to do it (it is an iterativ algorithm, but can't remember it exactly. One had the so called yulewalk algorith inside, maybe this helps).
Anyway, I decided to shuffle the IIR coefficients some thousand times until a special epsillon is reached. This is not the best method, but it works for me.
If someone knows a better way, please let me know too.

Good luck,

Christian

P.S.: With one approach I used Laurent de Soras "Different Evolution" algorithm, which I have successfully used for other things, but in this case the overhead was bigger then the gain.

Post

duncanparsons: can you explain a bit more how do you make design he filters depending on the freq plot, i have no experience in filter design (i should have read some books about filter design i guess)

Christian: thanks, this helps. I'll probably use the yulewalk algorithm since I don't care for the execution speed (offline process) and this algorithm is already implemented in scilab. Anyway, can you detail a bit more how you "shuffle" the IIRC coefficients: pure random IIRC coefs each time and you compare the freq plots?

Post

zieQ wrote:say for a real-time emulation of a cabinet impulse response.
If the cab's sound is what you're aiming at, try also modelling the real dimensions. Sounding like a cab is not only a frequency-domain affair but also a function of time. Think of the enclosure as a small reverberating box. That's often neglected and quickly leads to a static sound that just appears to be 'EQed'. Real enclosures live and breathe because the've got 'space' to do so. Try a filtered signal (the driver; also think about distortion) fed through a multitap delay (or an FDN), filter again, put phase reverse here & there and play with the mix of speaker vs. enclosure. You end up with a weird frequency response for free ;)
Sascha Eversmeier [formerly digitalfishphones]
TOURAGE DSP
croquesolid drum processor- mix real drums fast & focused

Post

Dunno if this is any help, not that well desinged interface imo but you can set constraints and design 6 or 7 differant types of filters with it.

http://www.icsi.berkeley.edu/~storn/fiwiz.html

It uses differntial evolution, and if you know how to test the frequeny response of the IIR it shouldnt be too dificult to use it to evolve one to fit whatever response you need. I've used it a few times (not for filters tho) and had great results from it.

http://www.icsi.berkeley.edu/~storn/code.html

Post

Thanks sascha, this is very informative. Anyway, i do not attemp to mimick the real response of cabinets, i just want a quick and dirty cab emulation to test some distortion devices. That's why I asked for lower-order IIR filters :wink:

Post

The prony and stmcb functions in Matlab can be used for this. Prony is also available in GNU Octane.
I have used this approach in Tubebaby, where I am using 32 cascaded Biquads for the cab emulation, which are derived from some IRs from Noisevault.
I agree with Sascha though, that the results aren't very realistic, there's more to real cabs than the frequency response.

Anyway, if you want the coeffs just for testing purposes, you may pm me, and I'd be willing to share mine.

Post

if you restrict yourself to purely recursive IIR-filters (filters with feedforward-coeffs identically zero), then you are trying to estimate an auto-regressive (AR) model. this is nothing different than linear prediction (this is the way my, LPC-vocoder works). several algorithms exist to estimate such a model ( i implemented some variation of LMS in the LPC-vocoder but for offline-processing i would recommend the levinson/durbin recursion ). for the more general case of a digital filter with a feedforward-path, you would have to estimate an ARMA (auto-regressive moving average) model. i think, this is quite complicated and it can be shown that ARMA-models can be approximated to arbitraty precision with AR-models if only the order of the AR-model is high enough. for a AR estimation i would feed the impulse response with white noise (which is always the assumed input signal in linear prediction) and then use levinson/durbin on the output signal.
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

braindoc wrote:if you restrict yourself to purely recursive IIR-filters (filters with feedforward-coeffs identically zero), then you are trying to estimate an auto-regressive (AR) model. this is nothing different than linear prediction (this is the way my, LPC-vocoder works). several algorithms exist to estimate such a model ( i implemented some variation of LMS in the LPC-vocoder but for offline-processing i would recommend the levinson/durbin recursion ). for the more general case of a digital filter with a feedforward-path, you would have to estimate an ARMA (auto-regressive moving average) model. i think, this is quite complicated and it can be shown that ARMA-models can be approximated to arbitraty precision with AR-models if only the order of the AR-model is high enough. for a AR estimation i would feed the impulse response with white noise (which is always the assumed input signal in linear prediction) and then use levinson/durbin on the output signal.
In other words, if you don't care about matching the phase, it is not a big problem to match the frequency response. It's been a while since I had this topic at the university, but as far as I remember the phase information is cancelled out in one step to get the AR model.

Kind regards,

Christian

Post

Christian Budde wrote: It's been a while since I had this topic at the university, but as far as I remember the phase information is cancelled out in one step to get the AR model.
really is it? it's some time ago for me, too
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

braindoc wrote:
Christian Budde wrote: It's been a while since I had this topic at the university, but as far as I remember the phase information is cancelled out in one step to get the AR model.
really is it? it's some time ago for me, too
The only thing I remember exactly is where I can look. The book is on the attic. I will bring it down tomorrow.

Post

I think it's time for me to read some theory about AR and ARMA models, and maybe some about LPC ;) Thanks to all of you.

Anyway, Christian, can you tell me a bit more about the technique you used in posihfopit ?

Post

zieQ wrote:Anyway, Christian, can you tell me a bit more about the technique you used in posihfopit ?
It's very simple, but here we go:
1. calc the desired frequency response (usually given)
2. calc the current frequency response of your biquad filter (formulas can be found in the music dsp archieve).
3. Implement a so called "cost" function: e.g. substract desired and current frequency response for each frequency you have calculated and add these values.
4. Change one property. In my case I change for example the gain of filter 1
5. Check if the new "cost" is less then the old "cost". If so keep the change, if not, skip the change.
6. Continue with Step 4, but with another "property". Repeat until the "costs" are below a certain epsilon.

This method works very well if you need to adjust a higher level of equalizers (e.g. Peak EQs)
It's a bit tricky to find a good "cost" function and the optimal order of properties. One can see, that if you fitted one filter to reduce the cost function perfectly. It's sometimes hard for the others to reduce it even further. For example: You want to do something like this:

Code: Select all

    +---+
    |   |
----+   +----->
Then the first best filter will look like this (symmetrical within the middle)

Code: Select all

    +---+
    | ^ |
----+/ \+----->
Now we have a second filter. How would the perfect solution (for both filters) may look like and how will it look like if we now set the second filter to reduce the costs perfectly (using the one filter already set)?

Regards,

Christian

P.S.: I've already mentioned that a generic algorithm may give better results, but for me it doesn't work very well and it was slower than this simple approach.

Post

Thanks, your explanation is clear to me :wink:

Post Reply

Return to “DSP and Plugin Development”