508 Practical MATLAB® Applications for Engineers
Example 5.2
Given the sequences f 1 (n) = [0.3nu(n)] and f 2 (n) = [0.9nu(n)]
a. Evaluate by hand the DTFT of f 1 (n) and f 2 (n).
Create the script fi le DTFT_properties that returns the following:
b. Plots of f 1 (n) versus n and f 2 (n) versus n, over the range 0 ≤ n ≤ 9.
c. The magnitude and phase plots of DTFT of f1(n) and f 2 (n), over the range −π <
W < +π.
d. Verify the even symmetry of the relation real[F 1 (ejW)] = real[F 1 (e −jW)] and odd sym-
metry of imagl[F 1 (ejW)] = imag[−F 1 (e −jW)].
e. Use the linear property of DTFT and evaluate and plot the time–frequency relation
2f1(n) + 3f 2 (n) ⇔ 2F 1 (ejW) + 3F 2 (ejW).
f. Verify that F 1 (ejW) and F 2 (ejW) are periodic functions with periods of 2π, by plotting
each function over the range − 2 π < W < 2 π.
g. Compare the DTFT of Example 5.1 with the DTFT of part c and observe that if
f(n) = anu(n), then as a increases the BW decreases, as long as |a| < 1.
ANALYTICAL Solution
Part a
FejW f nejWn
n
11 () ()
∑
FejW nejWn
n
1 ()^03 .
∑
Fe e e
e
e
e
jW n jWn
n
jW
n
n
jW
jW
(^1) JW
00
03 03
1
103
(). (. )
.
∑∑ 0 03.
FejW f nejWn
n
22 () ()
∞
∑
Fe e e
e
e
e
jW n jWn
n
jW
n
n
jW
jW
(^2) JW
00
09 09
1
109
(). (. )
.
∑∑ 0 09.
MATLAB Solution
% Script file: DTFT _ properties
n = 0:9;
f1 = (0.3.ones(1,10)).^n;
f2 = (0.9.ones(1,10)).^n;
figure(1)
nn= [(-4:-1) n];f1nn =[zeros(1,4) f1];
subplot (2,1,1)