02.10.2019 Views

UploadFile_6417

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

340 Chapter 7 FIR FILTER DESIGN<br />

hd(n)<br />

0.8<br />

0.6<br />

0.4<br />

0.2<br />

Ideal Impulse Response<br />

w(n)<br />

1<br />

0.8<br />

0.6<br />

0.4<br />

Kaiser Window<br />

0<br />

0.2<br />

−0.2<br />

0 10 20 30 40<br />

n<br />

0.8<br />

0.6<br />

Actual Impulse Response<br />

0<br />

0 10 20 30 40<br />

n<br />

0<br />

Magnitude Response in dB<br />

h(n)<br />

0.4<br />

0.2<br />

Decibels<br />

0<br />

−0.2<br />

0 10 20 30 40<br />

n<br />

60<br />

0 1/3 2/3 1<br />

frequency in π units<br />

FIGURE 7.22 Bandstop filter plots in Example 7.11: β =5.9533<br />

>> M = 45; As = 60; n=[0:1:M-1];<br />

>> beta = 0.1102*(As-8.7)+0.3<br />

beta = 5.9533<br />

>> w_kai = (kaiser(M,beta))’; wc1 = pi/3; wc2 = 2*pi/3;<br />

>> hd = ideal_lp(wc1,M) + ideal_lp(pi,M) - ideal_lp(wc2,M);<br />

>> h = hd .* w_kai; [db,mag,pha,grd,w] = freqz_m(h,[1]);<br />

>> subplot(2,2,1); stem(n,hd); title(’Ideal Impulse Response’)<br />

>> axis([-1 M -0.2 0.8]); xlabel(’n’); ylabel(’hd(n)’)<br />

>> subplot(2,2,2); stem(n,w_kai);title(’Kaiser Window’)<br />

>> axis([-1 M 0 1.1]); xlabel(’n’); ylabel(’w(n)’)<br />

>> subplot(2,2,3); stem(n,h);title(’Actual Impulse Response’)<br />

>> axis([-1 M -0.2 0.8]); xlabel(’n’); ylabel(’h(n)’)<br />

>> subplot(2,2,4);plot(w/pi,db); axis([0 1 -80 10]);<br />

>> title(’Magnitude Response in dB’);grid;<br />

>> xlabel(’frequency in pi units’); ylabel(’Decibels’)<br />

The time- and the frequency-domain plots are shown in Figure 7.22, in which<br />

the designed filter satisfies the necessary requirements.<br />

□<br />

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).<br />

Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!