MATLAB IIR Filter Functions

There are several functions built-in to the MATLAB Signal Processing Toolbox which can be used to create IIR filters. Similar to the FIR filter functions, the IIR functions make it possible for a programmer to specify the type of filter (LPF, HPF, etc.) along with the defining characteristics (cut-off frequency, amplitude, etc.) and MATLAB produces the coefficients for the filter.

Two types of filter design approaches are Butterworth and Elliptic filters. The MATLAB functions that create these IIR filters are butter and ellip, respectively.

The following is the syntax for using butter:

[b,a] = butter(m,Wn,ftype) 

Input Variables:

m – filter order, length of impulse response. Example: 4

Wn – normalized cut-off frequency. Example: 0.5

ftype – filter type. Example: 'low' , 'high' , 'pass' , 'stop' 

Output Variables:

b – coefficients of feed-forward gains.

a – coefficients of feed-back gains.

The following is the syntax for using ellip:

[b,a] = ellip(m,Rp,Rs,Wn,ftype) 

Input Variables:

m – filter order, length of impulse response. Example: 4

Rp – allowable pass-band ripple in dB.

Rs – stop-band attenuation.

Wn – normalized cut-off frequency. Example: 0.5

ftype – filter type. Example: 'low' , 'high' , 'pass' , 'stop' 

Output Variables:

b – coefficients of feed-forward gains.

a – coefficients of feed-back gains.