DSPRelated.com
Forums

IIR to FIR with window convertion

Started by haak...@hotmail.com May 26, 2006
Hi all.

I have a question about a issue here.
I want to convert a non-linear IIR filter to a linear FIR filter as well as applying a window to it.

It seems like I'm doing it wrong as frequenserespons I get of my new filter never goes to zero (or close to zero) in the stopband, as well as the bandpass does not look good either.

the code:
b_window = hanning(100);
[b,a] = butter(10,0.5,'low');
impulse=[1 zeros(1,99)];
b_of_iir = filter(b,a,impulse);

bb = rot90(rot90(b_of_iir).*b_window);
freqz(bb);
As far as I know the "FIR coeffesients" from the IIR filter is obtainable when putting an impulse respons on the IIR filter and afterwards weightening the coeffesients with any window function.
But when comparing with any windowing with the function fir1, it looks really ugly.

So I have to know, is my procedure correct at all?
If not, could anyone post a pseudo code of how it should be done?

Best regards
Hakon