# Need help with the IIR fitler design to filter pulse signals

1. ## Need help with the IIR fitler design to filter pulse signals

Hello,

I already used an FIR lowpass fitler as shown below with a fc=4Hz and sampling freq=100Hz for the data attached

Code:
```Hf = fdesign.lowpass('N,Fc',31,4,100);
Hd =design (Hf);
Coeff= Hd.Numerator;
data3= filtfilt(Hd.Numerator,1,a);```
But, I now I want to design the IIR fitler for the same to check the difference between the both implementation with the microcontroller.

can someone help with the better lowpass IIR filter design in matlab for the input pulse signal (data attached) if the needed fc=4Hz and sampling freq=100Hz.

pulse_data5000.txt

Thanks.

•

2. ## Re: Need help with the IIR fitler design to filter pulse signals

Read the Matlab help aboit IIR design methods. fdesign.lowpass('N,Fc',...) is only valid for FIR.

Apart from this point I don't agree with your assumption about "better lowpass IIR filter". FIR is basically good, although order of 31 is insufficient for a good lowpass filter with fc/fs = 4/100.

•

3. ## Re: Need help with the IIR fitler design to filter pulse signals

I guess you misunderstood me.
Sorry, its my fault for not explaining this clearly "design the IIR fitler for the same".
I mean I want use the same data for designing the IIR filter but not the same method of FIR.

1)you said"although order of 31 is insufficient for a good lowpass filter with fc/fs = 4/100."
Waht is the formual used to calculate the best or sufficient order for requirements.

2)can I get some help with the IIR filter design implementation like with selection of type(chebyshev type I or type II or butterworth or any other method) and order to be used for my requirement.
Thanks.

•

4. ## Re: Need help with the IIR fitler design to filter pulse signals

I understood you well. The answer is in the Matlab help. You have to review the required fdesign syntax for IIR filter.

A 5th order butterworth filter can be e.g. requested

Hf = fdesign.lowpass('N,F3dB',5,4,100);
Hd =design (Hf,'butter');

5. ## Re: Need help with the IIR fitler design to filter pulse signals

FvM : Thanks and you said "although order of 31 is insufficient for a good lowpass filter with fc/fs = 4/100."
can I know how to get (or know) the best or sufficient order for requirements.

--[[ ]]--