Você está na página 1de 5

LAB 5: DESIGN OF IIR DIGITAL FILTERS 1.

Ha(s) = Impulse Invariance a) Convert the analog filter into a digital IIR filter by means of the impulse invariance method. b) Plot the frequency response in S Domain and Z Domain. c) Plot the impulse response of the LTI model. d) Plot the impulse response in Z Domain. Bilinear Transformation e) Convert the above analog filter into a digital IIR filter by means of bilinear transformation. f) Plot the frequency response of the transformed filter by bilinear transformation. g) Plot the impulse response in Z Domain. h) Plot the step response of the LTI model. i) Step response of discrete time linear systems.
SOURCE CODE: num=[0 1 0.1]; den=[1 0.2 9.01]; [bz az]=impinvar(num,den,10)

%1. Ha(s) converted to Hd(z) by impulse invariance method

figure(1) bode(num,den) %2. frequency response of Ha(s) title('Original Filter Response') figure(2) freqz(bz,az) %2. frequency response of Hd(z) title('frequency response of Hd(z)from IM INV METHOD') figure(3) impulse(num,den) %3. impluse response of Ha(s) title('Impulse response of Ha(s)') figure(4) dimpulse(bz,az) %4. impulse response of Hd(z) title('Impulse response of Hd(z)from IM INV METHOD') [bz az]=bilinear(num,den,10) %5. Ha(s) converted to Hd(z) by bilinear transformation figure(5) freqz(bz,az) %6. frequency response of Hd(z) title('frequency response of Hd(z) from BILIN METHOD') figure(6) dimpulse(bz,az) %7. impulse response of Hd(z) title('Impulse response of Hd(z) from BILIN METHOD')
1| Shailesh Dahal (35/BEX/2064)

figure(7) step(num,den) %8. step response of Ha(s) title('step response of Ha(s)') figure(8) dstep(bz,az) %9. step response of Hd(z) title('step response of Hd(z)from BILIN METHOD') OUTPUT: Figure: 1 Figure: 2

Figure: 3

Figure: 4
Figure: 1

Figure: 6

Figure: 5 SOURCE CODE: num=[1 2.5 1.12 0.7 -0.456]; den=[1 0 0 0 0]; k=tf2latc(num,den) OUTPUT:
2| Shailesh Dahal (35/BEX/2064)

Figure: 7

Figure: 8

2. Design of Butterworth Lowpass Filter: An IIR digital low pass filter is required to meet following specifications: Pass band attenuation4dB, Stop band attenuation30dB, Passband edge=400Hz, Stopband edge=800Hz, Sample rate=2KHz. Find its order. Plot its frequency response. Plot its pole and zeros. Draw its signal flow graph, direct form I, Direct form II, Transposed form, Lattice ladder structure and parallel form.
SOURCE CODE: rp=4; rs=30; fp=400; fs=800; f=2000; nfp=2*fp/f; %freq normalization nfs=2*fs/f; %freq normalization [n wn]=buttord(nfp,nfs,rp,rs) [bz,az]=butter(n,wn) %finding the filter coefficients figure(1) freqz(bz,az) %frequency response of the LP BW filter title('frequency response') figure(2) zplane(bz,az) title('pole and zero location') OUTPUT: n=3 bz=0.1600 az=1.0000
3|

wn=0.4914 0.4800 0.4800 -0.0494 0.3340

0.1600 -0.0045
Shailesh Dahal (35/BEX/2064)

Figure: 1

Figure: 2

3. Desing of Chebyshev I and II lowpass filter: An IIR digital low pass filter is required to meet following specifications: Pass band attenuation1dB, Stop band attenuation15dB, Passband edge frequency=0.2 rad/sec, Stopband edge frequency=0.3 rad/sec. Find its order. Plot its frequency response.
SOURCE CODE: rp=1; rs=15; fp=0.2*pi; fs=0.3*pi; [n1 wn1]=cheb1ord(fp/pi,fs/pi,rp,rs) [bz1 az1]=cheby1(n1,10,wn1) figure(1) freqz(bz1,az1) title('frequecy responsee of chebyshev I') [n2 wn2]=cheb2ord(fp/pi,fs/pi,rp,rs) [bz2 az2]=cheby2(n2,10,wn2) figure(2) freqz(bz2,az2) title('frequecy responsee of chebyshev II') OUTPUT: n1=4 wn1=0.2000 n2=4 wn2=0.3000

4|

Shailesh Dahal (35/BEX/2064)

DISCUSSION AND CONCLUSION: In the sixth lab, different approaches of digital IIR filter design were studied and butterworth and chebyshev I and II filters were designed from given criteria. The most commonly used approaches of digital filter design are Impulse invariance method and Bilinear transformation method. In Impulse invariance method, the objective is to design an IIR filter having an unit sample response h(n) that is sampled version of the impulse response of the analog filter. That is h(n)=h(nT); n=0,1,2. Where T is the sampling interval. In case of bilinear transformation, the mapping from s plane to z plane is done using: S= Impinvar() function converts the analog filter into digital one using impulse invariance method while bilinear() does the same using bilinear transformation. The frequency response of both the methods are nearly similar but not exact. Butterwoth, chebyshev I and II filters can be constructed using different functions available in MATLAB. We need the pass band and stop band frequency and attenuation to design the specific type of filter. Also to design digital filter, we need sampling frequency. Finally we use either impulse invariance or bilinear transformation for frequency mapping between digital and anlalog filters. From the order of filter determined from the functions, transfer function in s domain is found and finally converted to z domain. Hence from this lab, we became familiar with different methods of digital IIR filter design.

5|

Shailesh Dahal (35/BEX/2064)

Você também pode gostar