# What order of FIR filter is equivalent to an IIR filter for same design specifications and to get same magnitude response

I have to design a bandpass filter with passband frequency [300Hz 500Hz] and sampling frequency is 16kHz.The stopband attenuation required is 60dB.I have used butterworth filter in MATLAB to design the filter. Now to implement the same specifications using an FIR filter, what should be the order of filter chosen. My doubt is that if for any given filter design specification, is there any method by which we can say that an IIR filter of order M can generate a magnitude response equivalent to an FIR filter of order N

• That's not enough specification for a unique answer. You also need to add something like transition-band width(s), passband ripple, etc. Jan 20 at 8:34
• My doubt is that if for any given filter design specification, is there any method by which we can say that an IIR filter of order M can generate a magnitude response equivalent to an FIR filter of order N Jan 20 at 8:41
• Your comment significantly modifies the question. You should edit your question to include that doubt. Jan 21 at 17:48

This question could probably be flagged as a duplicate, but I'll answer here and let the mods decide if it's worth keeping.

1. $$N = \bigg\lfloor\frac{f_s}{\Delta f}\frac{\mathtt{Attn(dB)}}{22}\bigg\rfloor$$ For your specs, $$N = \big\lfloor\frac{16e3}{200}\frac{60}{22}\big\rfloor = 218$$

3. Matlab firpmord function for Parks-McClellan FIR design. You need to specify the transition bands (see end of this answer for example code)

4. There's no universal rule. You can start with some ballpark $$N$$ and increase until you meet your specs.

Matlab Code for 3.

rp = 0.1;           % Passband ripple in dB
rs = 60;          % Stopband ripple in dB
fs = 16000;        % Sampling frequency
f = [200 300 500 600];    % Cutoff frequencies
a = [0 1 0];        % Desired amplitudes

dev = [10^(-rs/20) (10^(rp/20)-1)/(10^(rp/20)+1) 10^(-rs/20)]; %linear
[n,fo,ao,w] = firpmord(f,a,dev,fs);
b = firpm(n,fo,ao,w);
freqz(b,1,4096,fs)
title('bandpass Filter Designed to Specifications')

• Thanks @DanBoschen, will add to the answer. Like I said, I think this question has been asked and answered before, but since my answer is tailored to the OP's question, I figured it might be worth it.
– Jdip
Jan 20 at 13:14
• Yes agree, the question is more specific--- what you are missing but you could add is how it relates to N for an all pole IIR (where we get 20 dB/decade for each pole... so 20N dB/decade which could be backed out into a form similar to fred's...) .then we see exactly the answer to his question in terms of these initial estimates. This would be specific to all pole IIR rather than what is mixed FIR/IIR as typically done in IIR filters with poles and zeros. I'm deleting my earlier comment since it's now in your answer and just noise down here. Jan 20 at 13:25
• @DanBoschen If I get some bandwidth I'll gladly add. But feel free to edit my answer or do one with what you mentioned, I'd be interested in your derivation.
– Jdip
Jan 20 at 13:35