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.

Window Design Techniques 343<br />

Ideal Impulse Response<br />

Hann Window<br />

1<br />

0.5<br />

1<br />

0.8<br />

hd(n)<br />

0<br />

w(n)<br />

0.6<br />

−0.5<br />

−1<br />

0 5 10 15 20<br />

n<br />

0.4<br />

0.2<br />

0<br />

0 5 10 15 20<br />

n<br />

Actual Impulse Response<br />

Amplitude Response<br />

1<br />

1<br />

0.5<br />

h(n)<br />

0<br />

Hr<br />

0<br />

−0.5<br />

−1<br />

0 5 10 15 20<br />

n<br />

−1<br />

−1 0 1<br />

frequency in π units<br />

FIGURE 7.24 FIR Hilbert transformer design in Example 7.13<br />

>> subplot(2,2,2); stem(n,w_han);title(’Hann Window’)<br />

>> axis([-1 M 0 1.2]); xlabel(’n’); ylabel(’w(n)’)<br />

>> subplot(2,2,3); stem(n,h);title(’Actual Impulse Response’)<br />

>> axis([-1 M -1.2 1.2]); xlabel(’n’); ylabel(’h(n)’)<br />

>> w = w’; Hr = Hr’;<br />

>> w = [-fliplr(w), w(2:501)]; Hr = [-fliplr(Hr), Hr(2:501)];<br />

>> subplot(2,2,4);plot(w/pi,Hr); title(’Amplitude Response’);grid;<br />

>> xlabel(’frequency in pi units’); ylabel(’Hr’); axis([-1 1 -1.1 1.1]);<br />

The plots are shown in Figure 7.24. Observe that the amplitude response is<br />

plotted over −π ≤ ω ≤ π.<br />

□<br />

The SP toolbox provides a function called fir1 which designs conventional<br />

lowpass, highpass, and other multiband FIR filters using window<br />

technique. This function’s syntax has several forms, including:<br />

• h = fir1(N,wc) designs an Nth-order (N = M − 1) lowpass FIR<br />

filter and returns the impulse response in vector h. Bydefault this is<br />

a Hamming-window based, linear-phase design with normalized cutoff<br />

frequency in wc which is a number between 0 and 1, where 1 corresponds<br />

to π rad/sample. If wc is a two-element vector, i.e., wc = [wc1 wc2],<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!