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.

The Discrete Fourier Transform 163<br />

2<br />

1<br />

0<br />

−1<br />

−2<br />

10<br />

signal x(n), 0 Y1 = dft(y1,10); magY1 = abs(Y1(1:1:6));<br />

>> k1 = 0:1:5 ;w1 = 2*pi/10*k1;<br />

>> subplot(2,1,2);stem(w1/pi,magY1);title(’Samples of DTFT Magnitude’);<br />

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

The plots in Figure 5.9 show there aren’t enough samples to draw any conclusions.<br />

Therefore we will pad 90 zeros to obtain a dense spectrum. As explained<br />

in Example 5.7, this spectrum is plotted using the plot command.<br />

MATLAB Script:<br />

>> n2 = [0:1:99]; y2 = [x(1:1:10) zeros(1,90)];<br />

>> subplot(2,1,1) ;stem(n2,y2) ;title(’signal x(n), 0 xlabel(’n’)<br />

>> Y2 =dft(y2,100); magY2 = abs(Y2(1:1:51));<br />

>> k2 = 0:1:50; w2 = 2*pi/100*k2;<br />

>> subplot(2,1,2); plot(w3/pi,magY3); title(’DTFT Magnitude’);<br />

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

Now the plot in Figure 5.10 shows that the sequence has a dominant frequency<br />

at ω =0.5π. This fact is not supported by the original sequence, which has two<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!