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.

354 Chapter 7 FIR FILTER DESIGN<br />

Solution<br />

Recall that for a highpass filter M must be odd (or Type-1 filter). Hence we<br />

will choose M =33toget two samples in the transition band. With this choice<br />

of M it is not possible to have frequency samples at ω s and ω p. The samples of<br />

the amplitude response are<br />

H r (k) =[0,...,0 ,T<br />

} {{ } 1,T 2, 1,...,1 ,T<br />

} {{ } 2,T 1, 0,...,0 ]<br />

} {{ }<br />

11<br />

8<br />

10<br />

while the phase response samples are<br />

⎧<br />

⎪⎨ − 33 − 1 2π<br />

2 33 k = − 32 πk, 0 ≤ k ≤ 16<br />

33<br />

̸ H (k) =<br />

⎪⎩ + 32 π (33 − k) , 17 ≤ k ≤ 32<br />

33<br />

The optimum values of transition samples are T 1 =0.1095 and T 2 =0.598.<br />

Using these values, the MATLAB design is given in the following script.<br />

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

>> T1 = 0.1095; T2 = 0.598;<br />

>> Hrs = [zeros(1,11),T1,T2,ones(1,8),T2,T1,zeros(1,10)];<br />

>> Hdr = [0,0,1,1]; wdl = [0,0.6,0.8,1];<br />

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

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

>> H = Hrs.*exp(j*angH); h = real(ifft(H,M));<br />

>> [db,mag,pha,grd,w] = freqz_m(h,1); [Hr,ww,a,L] = Hr_Type1(h);<br />

The time- and the frequency-domain plots of the design are shown in<br />

Figure 7.31.<br />

□<br />

□ EXAMPLE 7.19 Design a 33-point digital differentiator based on the ideal differentiator of (7.31)<br />

given in Example 7.12.<br />

Solution<br />

From (7.31) the samples of the (imaginary-valued) amplitude response are given<br />

by<br />

⎧<br />

⎪⎨ +j 2π ⌊ ⌋ M − 1<br />

M k, k =0,..., 2<br />

jH r (k) =<br />

⎪⎩ −j 2π ⌊ ⌋ M − 1<br />

M (M − k) ,k= +1,...,M − 1<br />

2<br />

and for linear phase the phase samples are<br />

⎧<br />

⎪⎨ − M − 1 2π<br />

2 M k = − M − 1<br />

⌊ ⌋ M − 1<br />

M πk, k =0,..., 2<br />

̸ H (k) =<br />

⎪⎩ + M − 1<br />

⌊ ⌋ M − 1<br />

M π (M − k) , k = +1,...,M − 1<br />

2<br />

Therefore<br />

H (k) =jH r (k) e j̸ H(k) , 0 ≤ k ≤ M − 1 and h (n) =IDFT [H (k)]<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!