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.

484 Chapter 9 SAMPLING RATE CONVERSION<br />

|X(ω x )|<br />

|V(ω x )|<br />

−π<br />

ω x<br />

0 π<br />

π<br />

− 0<br />

D<br />

H(ω x )<br />

|Y(ω y )|<br />

π<br />

D<br />

ω x<br />

FIGURE 9.7<br />

− π D<br />

0<br />

π<br />

D<br />

ω x<br />

Spectra of signals in the decimation of x(n) by a factor D<br />

−π<br />

0<br />

π<br />

ω y<br />

□ EXAMPLE 9.2 Let x(n) = cos(0.125πn). Generate a large number of samples of x(n) and<br />

decimate them using D =2,4,and 8 to show the results of decimation.<br />

Solution<br />

We will plot the middle segments of the signals to avoid end-effects due to<br />

the default lowpass filter in the decimate function. The following MATLAB<br />

script shows details of these operations, and Figure 9.7 shows the plots of the<br />

sequences.<br />

n = 0:2048; k1 = 256; k2 = k1+32; m = 0:(k2-k1);<br />

Hf1 = figure(’units’,’inches’,’position’,[1,1,6,4],...<br />

’paperunits’,’inches’,’paperposition’,[0,0,6,4]);<br />

% (a) Original signal<br />

x = cos(0.125*pi*n); subplot(2,2,1);<br />

Ha = stem(m,x(m+k1+1),’g’,’filled’); axis([-1,33,-1.1,1.1]);<br />

set(Ha,’markersize’,2); ylabel(’Amplitude’);<br />

title(’Original Sequence x(n)’,’fontsize’,TF);<br />

set(gca,’xtick’,[0,16,32]); set(gca,’ytick’,[-1,0,1]);<br />

% (b) Decimation by D = 2<br />

D = 2; y = decimate(x,D); subplot(2,2,2);<br />

Hb = stem(m,y(m+k1/D+1),’c’,’filled’); axis([-1,33,-1.1,1.1]);<br />

set(Hb,’markersize’,2); ylabel(’Amplitude’);<br />

title(’Decimated by D = 2’,’fontsize’,TF);<br />

set(gca,’xtick’,[0,16,32]); set(gca,’ytick’,[-1,0,1]);<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!