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.

356 Chapter 7 FIR FILTER DESIGN<br />

1.5<br />

Differentiator, frequency sampling design : M = 33<br />

Hr in π units<br />

1<br />

0.5<br />

0<br />

−0.5<br />

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1<br />

frequency in π units<br />

1<br />

0.5<br />

Impulse response<br />

h(n)<br />

0<br />

−0.5<br />

−1<br />

0 16 32<br />

n<br />

FIGURE 7.32 Differentiator design plots in Example 7.19<br />

Since this is a Type-3 linear-phase filter, the amplitude response will be zero<br />

at ω = π. Hence to reduce the ripples, we should choose the two samples (in<br />

transition bands) near ω = π optimally between 0 and j. Using our previous<br />

experience, we could select this value as 0.39j. The samples of the phase response<br />

are selected similar to those in Example 7.19.<br />

MATLAB script:<br />

>> M = 51; alpha = (M-1)/2; Dw = 2*pi/M; l = 0:M-1; wl = Dw*l;<br />

>> k1 = 0:floor((M-1)/2); k2 = floor((M-1)/2)+1:M-1;<br />

>> Hrs = [0,-j*ones(1,(M-3)/2),-0.39j,0.39j,j*ones(1,(M-3)/2)];<br />

>> angH = [-alpha*Dw*k1, alpha*Dw*(M-k2)];<br />

>> H = Hrs.*exp(j*angH); h = real(ifft(H,M)); [Hr,ww,a,P]=Hr_Type3(h);<br />

The plots in Figure 7.33 show the effect of the transition band samples.<br />

□<br />

The SP toolbox provides a function called fir2 which combines frequency<br />

sampling technique with the window technique to design arbitrary<br />

shaped magnitude response FIR filters. After computing filter impulse<br />

response using the naive design method, fir2 then applies a selected<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!