02.10.2019 Views

UploadFile_6417

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

370 Chapter 7 FIR FILTER DESIGN<br />

Actual Impulse Response<br />

Magnitude Response in dB<br />

0.4<br />

0<br />

h(n)<br />

0.2<br />

0<br />

−0.2<br />

Decibels<br />

60<br />

−0.4<br />

0 30<br />

n<br />

1<br />

Amplitude Response<br />

0 0.2 0.35 0.65 0.8 1<br />

frequency in π units<br />

×<br />

Weighted Error<br />

10−3<br />

1.0575<br />

Hr(w)<br />

Hr(w)<br />

0<br />

0<br />

0 0.2 0.35 0.65 0.8 1<br />

frequency in π units<br />

−1.0575<br />

0 0.2 0.35 0.65 0.8 1<br />

frequency in π units<br />

FIGURE 7.36 Plots for equiripple bandpass FIR filter in Example 7.24<br />

The optimal value of M was found to be 29. The time- and the frequency-domain<br />

plots of the designed filter are shown in Figure 7.36.<br />

□<br />

□ EXAMPLE 7.25 Design a highpass filter that has the following specifications:<br />

ω s =0.6π,<br />

ω p =0.75π,<br />

A s =50dB<br />

R p =0.5 dB<br />

Solution<br />

Since this is a highpass filter, we must ensure that the length M is an odd<br />

number. This is shown in the following MATLAB script.<br />

>> ws = 0.6*pi; wp = 0.75*pi; Rp = 0.5; As = 50;<br />

>> [delta1,delta2] = db2delta(Rp,As);<br />

>> [N,f,m,weights] = firpmord([ws,wp]/pi,[0,1],[delta2,delta1]); N<br />

N = 26<br />

>> h = firpm(N,f,m,weights);<br />

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

>> delta_w = 2*pi/1000; wsi=ws/delta_w; wpi = wp/delta_w;<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!