Вы находитесь на странице: 1из 5

Experiment no:5

Date:28-07-2011

BUTTEWORTH IIR FILTERS


Objective: To obtain the magnitude and phase response using IIR filters. Tools required: Windows Operating systems MATLAB

Theory: Filters depending are broadly classified into two types, the characteristics and nature of

upon

impulse response taken into the considerations is of infinite duration, the filters are termed as Infinite Impulse Response filters or IIR Filters. On the other hand, filter Filters if is FIR the impulse duration Depending is finite, Response the then or the FIR of each called the Finite Impulse

filters.

upon

methods

calculating

impulse

response

coefficients,

kind of IIR filter is divided into two main types Butterworth filters Chebyshev filters The convolution sum, which relates the input and output signals is represented as Y (n) = h (k) + x (n-k) 0 k

From the above equation it is clear that for IIR filters the impulse response is of infinite duration. In practice, it is not feasible to compute the output of the IIR filter using the above equation because the length of its impulse response is too long. Instead, the IIR filter equation is expressed in a recursive form as Y (n) = bk1*x (n-k1) - ak2y (n-k2) Where, 0 k1 n1 & 0 k1 M Algorithm: Step1: Enter the pass band and stop band frequencies and attenuations and also the nyquist rate. Step2: Find the normalized frequencies of pass band and stop band frequencies. Step3: Find the order and cut-off frequency of Butterworth filter. Step4: filters. Program: % IIR LOW PASS FILER DESIGN WP = input (pass band corner frequency); WS = input (stop band corner frequency); Plot the magnitude and phase response for IIR

RP = input (pass band ripple); RS = input (stop band ripple); W=input (enter nyquist frequency); Wp=Wp. /W; Ws=Ws. /W; [n,Wn]=buttord (Wp, Ws, Rp, Rs); [z,p]=butter (n, Wn); Freqz (z, p, 512, 1000); title (mag & phase response); % IIR HIGH PASS FILTER DESIGN WP = input (pass band corner frequency); WS = input (stop band corner frequency); RP = input (pass band ripple); RS = input (stop band ripple); W=input (enter nyquist frequency); Wp=Wp./W; Ws=Ws./W; [n,Wn]=buttord (WP, Ws, Rp, Rs); [z,p]=butter (n, Wn,high); Freqz (z, p, 512, 1000); Title (mag & phase response); % IIR BAND PASS FILTER DESIGN WP = input (pass band corner frequency); WS = input (stop band corner frequency); RP = input (pass band ripple); RS = input (stop band ripple); W=input (enter nyquist frequency); WP=WP./W;

WS=WS./W; [n,Wn]=buttord (Wp, Ws, Rp, Rs); [z,p]=butter (n, Wn); Freqz (z, p, 512, 1000); title (mag & phase response); GRAPHS:

n 5B ttew rthL w a s F r = u r o o p s ilte 20 0 Magnitude (dB)

-2 0 0

-4 0 0

5 0

10 0

10 5

20 0 20 5 F q e c (H ) re u n y z

30 0

30 5

40 0

40 5

50 0

0 Phase (degrees)

-2 0 0

-4 0 0

-6 0 0

5 0

10 0

10 5

20 0 20 5 F q e c (H ) re u n y z

30 0

30 5

40 0

40 5

50 0

n=16 Butterworth Bandpass Filter 200 Magnitude (dB) 0 -200 -400 -600

50

100

150

200 250 300 Frequency (Hz)

350

400

450

500

0 Phase (degrees)

-1000

-2000

-3000

50

100

150

200 250 300 Frequency (Hz)

350

400

450

500

RESULT: Hence the IIR Butterworth filter is designed and cut-off frequencies are noted using MATLAB.

Вам также может понравиться