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.

504 Chapter 9 SAMPLING RATE CONVERSION<br />

Input Signal x(n)<br />

Output y(n): I = 5, Filter Length = 31<br />

1<br />

1<br />

Amplitude<br />

0<br />

Amplitude<br />

0<br />

−1<br />

−1<br />

0 4 8 12 16<br />

n<br />

0 20 40 60 80<br />

m<br />

Output y(n): I = 5, Filter Length = 51 Output y(n): I = 5, Filter Length = 81<br />

1<br />

1<br />

Amplitude<br />

0<br />

Amplitude<br />

0<br />

−1<br />

0 20 40 60 80<br />

m<br />

FIGURE 9.21 Signal plots in Example 9.9<br />

−1<br />

0 20 40 60 80<br />

m<br />

subplot(2,2,2); Hs2 = stem(m,y,’filled’); set(Hs2,’markersize’,2,’color’,’m’);<br />

axis([-5,85,-1.2,1.2]); set(gca,’xtick’,[0:4:16]*I,’ytick’,[-1,0,1]);<br />

title(’Output y(n): Filter length=31’,’fontsize’,TF);<br />

xlabel(’n’,’vertical’,’middle’); ylabel(’Amplitude’);<br />

The signal stem plots are shown in Figure 9.21. The upper left-hand plot shows<br />

a segment of the input signal x(n), and the upper right-hand plot shows the<br />

interpolated signal y(n) using the filter of length 31. The plot is corrected for<br />

filter delay and the effect of its transient response. It is somewhat surprising that<br />

the interpolated signal is not what it should be. The signal peak is more than<br />

one, and the shape is distorted. A careful observation of the filter response plot<br />

in Figure 9.20 reveals that the broad transition width and a smaller attenuation<br />

has allowed some of the spectral energy to leak, creating a distortion.<br />

To investigate this further, we designed filters with larger orders of 51 and<br />

81, as detailed in the following MATLAB script.<br />

% Interpolation with Filter Design: Length M = 51<br />

M = 51; F = [0,wp,ws,pi]/pi; A = [I,I,0,0];<br />

h = firpm(M-1,F,A,weights); y = upfirdn(x,h,I);<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!