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.

Frequency Sampling Design Techniques 347<br />

7.4.1 NAIVE DESIGN METHOD<br />

In this method we set H(k) =H d (e j2πk/M ), k =0,...,M − 1 and use<br />

(7.35) through (7.39) to obtain the impulse response h(n).<br />

□ EXAMPLE 7.14 Consider the lowpass filter specifications from Example 7.8.<br />

ω p =0.2π, R p =0.25 dB<br />

ω s =0.3π, A s =50dB<br />

Design an FIR filter using the frequency sampling approach.<br />

Solution<br />

Let us choose M =20sothat we have a frequency sample at ω p, that is, at<br />

k =2:<br />

ω p =0.2π = 2π<br />

20 2<br />

and the next sample at ω s, that is, at k =3:<br />

ω s =0.3π = 2π<br />

20 3<br />

Thus we have 3 samples in the passband [0 ≤ ω ≤ ω p] and 7 samples in the<br />

stopband [ω s ≤ ω ≤ π]. From (7.36) we have<br />

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

} {{ }<br />

15 zeros<br />

Since M = 20, α = 20−1 =9.5 and since this is a Type-2 linear-phase filter,<br />

2<br />

from (7.37) we have<br />

⎧<br />

⎨−9.5 2π<br />

̸ H (k) = 20 k = −0.95πk, 0 ≤ k ≤ 9<br />

⎩<br />

+0.95π (20 − k) , 10 ≤ k ≤ 19<br />

Now from (7.35) we assemble H (k) and from (7.39) determine the impulse<br />

response h (n). The MATLAB script follows:<br />

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

>> Hrs = [1,1,1,zeros(1,15),1,1]; %Ideal Amp Res sampled<br />

>> Hdr = [1,1,0,0]; wdl = [0,0.25,0.25,1]; %Ideal Amp Res for plotting<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_Type2(h);<br />

>> subplot(2,2,1);plot(wl(1:11)/pi,Hrs(1:11),’o’,wdl,Hdr);<br />

>> axis([0,1,-0.1,1.1]); title(’Frequency Samples: M=20’)<br />

>> xlabel(’frequency in pi units’); ylabel(’Hr(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!