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.

Problems 299<br />

4. Explain why the magnitude |Ĥ1(ejω )| is “different” from the magnitude |Ĥ2(ejω )|.<br />

P6.34 An IIR lowpass filter designed to meet the specifications of 0.5 dB ripple in the passband,<br />

60 dB ripple in the stopband, a passband edge frequency ω p =0.25π, and a stopband edge<br />

frequency ω s =0.3π is obtained using the following MATLAB script:<br />

wp = 0.25*pi; ws = 0.3*pi; Rp = 0.5; As = 60;<br />

[N, Wn] = ellipord(wp/pi, ws/pi, Rp, As);<br />

[b,a] = ellip(N,Rp,As,Wn);<br />

The filter coefficients b k and a k are in the arrays b and a, respectively, and can be<br />

considered to have infinite precision.<br />

1. Using infinite precision, plot the log-magnitude and phase responses of the designed<br />

filter. Use two rows and one column of subplots.<br />

2. Quantize the direct-form coefficients to 4 decimals (by rounding). Now plot the<br />

log-magnitude and phase responses of the resulting filter. Use 2 rows and 1 column of<br />

subplots.<br />

3. Quantize the direct form coefficients to 3 decimals (by rounding). Now plot the<br />

log-magnitude and phase responses of the resulting filter. Use 2 rows and 1 column of<br />

subplots.<br />

4. Comment on the plots in parts 1, 2, and 3.<br />

P6.35 Consider the digital lowpass filter used in Problem P6.34.<br />

1. Using infinite precision and cascade-form realization, plot the log-magnitude and phase<br />

responses of the designed filter. Use two rows and one column of subplots.<br />

2. Quantize the cascade-form coefficients to 4 decimals (by rounding). Now plot the<br />

log-magnitude and phase responses of the resulting filter. Use two rows and one column<br />

of subplots.<br />

3. Quantize the cascade-form coefficients to 3 decimals (by rounding). Now plot the<br />

log-magnitude and phase responses of the resulting filter. Use two rows and one column<br />

of subplots.<br />

4. Comment on the plots in the above three parts and compare them with the similar plots<br />

in Problem P6.34.<br />

P6.36 A length-32 linear-phase FIR bandpass filter that satisfies the requirements of 60 dB<br />

stopband attenuation, lower stopband edge frequency ω s1 =0.2π, and upper stopband edge<br />

frequency ω s2 =0.8π is obtained using the following MATLAB script.<br />

ws1 = 0.2*pi; ws2 = 0.8*pi; As = 60;<br />

M = 32; Df = 0.2115;<br />

fp1 = ws1/pi+Df; fp2 = ws2/pi-Df;<br />

h = firpm(M-1,[0,ws1/pi,fp1,fp2,ws2/pi,1],[0,0,1,1,0,0]);<br />

The filter impulse response h(n) isinthe array h and can be considered to have infinite<br />

precision.<br />

1. Using infinite precision, plot the log-magnitude and amplitude responses of the designed<br />

filter. Use 2 rows and 1 column of subplots.<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!