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.

368 Chapter 7 FIR FILTER DESIGN<br />

>> N = N+1<br />

N = 43<br />

>> h = firpm(N,f,m,weights); [db,mag,pha,grd,w] = freqz_m(h,[1]);<br />

>> Asd = -max(db(wsi:1:501))<br />

Asd = 48.2131<br />

>> N = N+1<br />

N = 44<br />

>> h = firpm(N,f,m,weights); [db,mag,pha,grd,w] = freqz_m(h,[1]);<br />

>> Asd = -max(db(wsi:1:501))<br />

Asd = 48.8689<br />

>> N = N+1<br />

N = 45<br />

>> h = firpm(N,f,m,weights); [db,mag,pha,grd,w] = freqz_m(h,[1]);<br />

>> Asd = -max(db(wsi:1:501))<br />

Asd = 49.8241<br />

>> N = N+1<br />

N = 46<br />

>> h = firpm(N,f,m,weights); [db,mag,pha,grd,w] = freqz_m(h,[1]);<br />

>> Asd = -max(db(wsi:1:501))<br />

Asd = 51.0857<br />

>> M = N+1<br />

M = 47<br />

Note that we stopped this iterative procedure when the computed stopband<br />

attenuation exceeded the given stopband attenuation A s, and the optimal value<br />

of M was found to be 47. This value is considerably lower than the window<br />

design techniques (M =61for a Kaiser window) or the frequency sampling<br />

technique (M = 60). In Figure 7.35 we show the time- and the frequencydomain<br />

plots of the designed filter along with the error function in both the<br />

passband and the stopband to illustrate the equiripple behavior.<br />

□ EXAMPLE 7.24 Let us design the bandpass filter described in Example 7.10 using the Parks-<br />

McClellan algorithm. The design parameters are:<br />

ω 1s =0.2π<br />

; R p =1dB<br />

ω 1p =0.35π<br />

ω 2p =0.65π<br />

; A s =60db<br />

ω 2s =0.8π<br />

Solution<br />

The following MATLAB script shows how to design this filter.<br />

>> ws1 = 0.2*pi; wp1 = 0.35*pi; wp2 = 0.65*pi; ws2 = 0.8*pi;<br />

>> Rp = 1.0; As = 60;<br />

>> [delta1,delta2] = db2delta(Rp,As);<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!