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.

70 Chapter 3 THE DISCRETE-TIME FOURIER ANALYSIS<br />

>> X = x * (exp(-j*pi/500)).^(n’*k); % DTFT of x<br />

>> % verification<br />

>> X_check = alpha*X1 + beta*X2; % Linear Combination of X1 & X2<br />

>> error = max(abs(X-X_check)) % Difference<br />

error =<br />

7.1054e-015<br />

Since the maximum absolute error between the two Fourier transform arrays<br />

is less than 10 −14 , the two arrays are identical within the limited numerical<br />

precision of MATLAB.<br />

□<br />

□ EXAMPLE 3.8 Let x(n) bearandom sequence uniformly distributed between [0, 1] over 0 ≤<br />

n ≤ 10 and let y(n) =x(n − 2). Then we can verify the sample shift property<br />

(3.6) as follows.<br />

>> x = rand(1,11); n = 0:10;<br />

>> k = 0:500; w = (pi/500)*k;<br />

>> X = x * (exp(-j*pi/500)).^(n’*k); % DTFT of x<br />

>> % signal shifted by two samples<br />

>> y = x; m = n+2;<br />

>> Y = y * (exp(-j*pi/500)).^(m’*k); % DTFT of y<br />

>> % verification<br />

>> Y_check = (exp(-j*2).^w).*X; % multiplication by exp(-j2w)<br />

>> error = max(abs(Y-Y_check)) % Difference<br />

error =<br />

5.7737e-015<br />

□<br />

□ EXAMPLE 3.9 To verify the frequency shift property (3.7), we will use the graphical approach.<br />

Let<br />

x(n) =cos(πn/2), 0 ≤ n ≤ 100 and y(n) =e jπn/4 x(n)<br />

Then using MATLAB,<br />

>> n = 0:100; x = cos(pi*n/2);<br />

>> k = -100:100; w = (pi/100)*k; % frequency between -pi and +pi<br />

>> X = x * (exp(-j*pi/100)).^(n’*k); % DTFT of x<br />

%<br />

>> y = exp(j*pi*n/4).*x; % signal multiplied by exp(j*pi*n/4)<br />

>> Y = y * (exp(-j*pi/100)).^(n’*k); % DTFT of y<br />

% Graphical verification<br />

>> subplot(2,2,1); plot(w/pi,abs(X)); grid; axis([-1,1,0,60])<br />

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

>> title(’Magnitude of X’)<br />

>> subplot(2,2,2); plot(w/pi,angle(X)/pi); grid; axis([-1,1,-1,1])<br />

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

>> title(’Angle of X’)<br />

>> subplot(2,2,3); plot(w/pi,abs(Y)); grid; axis([-1,1,0,60])<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!