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.

Window Design Techniques 337<br />

Solution There are two transition bands, namely, ∆ω 1<br />

△<br />

= ω1p −ω 1s and ∆ω 2<br />

△<br />

= ω2s −ω 2p.<br />

These two bandwidths must be the same in the window design; that is, there is<br />

no independent control over ∆ω 1 and ∆ω 2. Hence ∆ω 1 =∆ω 2 =∆ω. For this<br />

design we can use either the Kaiser window or the Blackman window. Let us<br />

use the Blackman Window. We will also need the ideal bandpass filter impulse<br />

response h d (n). Note that this impulse response can be obtained from two ideal<br />

lowpass magnitude responses, provided they have the same phase response. This<br />

is shown in Figure 7.19. Therefore the MATLAB routine ideal lp(wc,M) is<br />

sufficient to determine the impulse response of an ideal bandpass filter. The<br />

design steps are given in the following MATLAB script.<br />

>> ws1 = 0.2*pi; wp1 = 0.35*pi; wp2 = 0.65*pi; ws2 = 0.8*pi; As = 60;<br />

>> tr_width = min((wp1-ws1),(ws2-wp2)); M = ceil(11*pi/tr_width) + 1<br />

M = 75<br />

>> n=[0:1:M-1]; wc1 = (ws1+wp1)/2; wc2 = (wp2+ws2)/2;<br />

>> hd = ideal_lp(wc2,M) - ideal_lp(wc1,M);<br />

>> w_bla = (blackman(M))’; h = hd .* w_bla;<br />

>> [db,mag,pha,grd,w] = freqz_m(h,[1]); delta_w = 2*pi/1000;<br />

>> Rp = -min(db(wp1/delta_w+1:1:wp2/delta_w)) % Actua; Passband Ripple<br />

Rp = 0.0030<br />

>> As = -round(max(db(ws2/delta_w+1:1:501))) % Min Stopband Attenuation<br />

As = 75<br />

%Plots<br />

>> subplot(2,2,1); stem(n,hd); title(’Ideal Impulse Response’)<br />

>> axis([0 M-1 -0.4 0.5]); xlabel(’n’); ylabel(’hd(n)’)<br />

>> subplot(2,2,2); stem(n,w_bla);title(’Blackman Window’)<br />

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

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

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

>> subplot(2,2,4);plot(w/pi,db);axis([0 1 -150 10]);<br />

>> title(’Magnitude Response in dB’);grid;<br />

>> xlabel(’frequency in pi units’); ylabel(’Decibels’)<br />

0<br />

ω c2<br />

π<br />

+<br />

−<br />

0 ω c1<br />

0 ω c1 π<br />

ω c2<br />

π<br />

FIGURE 7.19<br />

Ideal bandpass filter from two lowpass filters<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!