DTFT, DFT, ZT, and FFT
505
5.4 Examples
Example 5.1
Let f(n) = 0.6
n u(n).
a. Evaluate the DTFT of f(n) by hand.
b. Create the script fi le DTFT that returns the magnitude and phase plots of the DTFT
of f(n) = 0.6
n u(n) of part a, over the range −π < W < π.
c. Repeat part b by using the MATLAB function freqz.
d. Evaluate the magnitude and phase errors of the two techniques employed (part b
and part c).
ANALYTICAL Solution
Part a
F e
f n e
jW
jWn
n
( )
( )
ϭ
Ϫ
ϭϪϱ
ϩϱ
∑
F e
u n e
jW
n
jWn
n
( )
.
( )
ϭ
ϭϪϱ
ϩϱ
0 6
−
∑
F e
e
e
e
jW
n
jWn
n
jW
n
n
jW
( )
.
( .
)
.
ϭ
ϭ
ϭ Ϫ
ϭ
ϩϱ
Ϫ
ϭ
ϱ
Ϫ
0 6
0 6
1
1 0 6
0
0
−
∑
∑
FIGURE 5.17
Plots of R.5.144.
Auto-correlation of fl(n)
20
10
0
Amplitude
−7 −6 −5 −4 −3 −2 −1
0
1
2
3
4
5
6
7
40
20
0
Amplitude
−7 −6 −5 −4 −3 −2 −1
0
1
2
3
4
5
6
7
40
20
0
Amplitude
−7 −6 −5 −4 −3 −2 −1
0
1
2
3
4
5
6
7
Cross-correlation of f2(n) with f1(n)
Cross-correlation of f1(n) with f2(n)
time index n
time index n
time index n
CRC_47760_CH005.indd 505
CRC_47760_CH005.indd 505
7/23/2008 1:47:30 PM
7/23/2008 1:47:30 PM
505
5.4 Examples
Example 5.1
Let f(n) = 0.6
n u(n).
a. Evaluate the DTFT of f(n) by hand.
b. Create the script fi le DTFT that returns the magnitude and phase plots of the DTFT
of f(n) = 0.6
n u(n) of part a, over the range −π < W < π.
c. Repeat part b by using the MATLAB function freqz.
d. Evaluate the magnitude and phase errors of the two techniques employed (part b
and part c).
ANALYTICAL Solution
Part a
F e
f n e
jW
jWn
n
( )
( )
ϭ
Ϫ
ϭϪϱ
ϩϱ
∑
F e
u n e
jW
n
jWn
n
( )
.
( )
ϭ
ϭϪϱ
ϩϱ
0 6
−
∑
F e
e
e
e
jW
n
jWn
n
jW
n
n
jW
( )
.
( .
)
.
ϭ
ϭ
ϭ Ϫ
ϭ
ϩϱ
Ϫ
ϭ
ϱ
Ϫ
0 6
0 6
1
1 0 6
0
0
−
∑
∑
FIGURE 5.17
Plots of R.5.144.
Auto-correlation of fl(n)
20
10
0
Amplitude
−7 −6 −5 −4 −3 −2 −1
0
1
2
3
4
5
6
7
40
20
0
Amplitude
−7 −6 −5 −4 −3 −2 −1
0
1
2
3
4
5
6
7
40
20
0
Amplitude
−7 −6 −5 −4 −3 −2 −1
0
1
2
3
4
5
6
7
Cross-correlation of f2(n) with f1(n)
Cross-correlation of f1(n) with f2(n)
time index n
time index n
time index n
CRC_47760_CH005.indd 505
CRC_47760_CH005.indd 505
7/23/2008 1:47:30 PM
7/23/2008 1:47:30 PM
