DTFT, DFT, ZT, and FFT
515
Example 5.4
Given the discrete sequence f(n) = [1 2 3],
a. Evaluate by hand the DTF coeffi cients of f(n)
b. Create the script fi le DFT_IDFT that returns the DTF of f(n)
c. Recover the sequence f(n) by evaluating the IDTF of part b
ANALYTICAL Solution
F k
f n e
j
nk
N
n
N
( )
( )
ϭ
Ϫ
ϭ
Ϫ
2
0
1
∑
F
fn
n
( )
( )
0
1 2 3 6
0
2
ϭ
ϭ ϩ ϩ ϭ
ϭ
∑
F
fne
e
e
i
j
n
n
j
j
( )
( )
.
.
1
1 2
3
1 5000 0 8660
2
3
0
2
2 3
4 3
ϭ
ϭ ϩ
ϩ
ϭ Ϫ
ϩ
Ϫ
ϭ
Ϫ
Ϫ
∑
F
fne
e
e
i
j
n
n
j
j
( )
( )
.
.
2
1 2
3
1 5000 0 8660
4
3
0
2
4 3
8 3
ϭ
ϭ ϩ
ϩ
ϭ Ϫ
Ϫ
Ϫ
ϭ
Ϫ
Ϫ
∑
MATLAB Solution
% Script file: DFT _ IDFT
fn = [1 2 3]
DTF _ fn = fft(fn);
disp(‘**************** R E S U L T S
**************** ’)
disp(‘The given time sequence is f(n) = [1 2 3]’)
disp(‘The DTF of f(n)=[1 2 3] using fft is given by :’)
disp(DTF _ fn)
fnn = ifft(DTF _ fn);
disp(‘The IDTF of the DFT of f(n)=[1 2 3] using ifft is given by:’)
disp(fnn)
disp(‘**************************************************** ’)
The script fi le DFT_IDFT is executed and the results are as follows:
******************* R E S U L T S ***********************
The given time sequence is f(n) = [1 2 3]
The DTF of f(n) = [1 2 3] using fft is given by:
6.0000
-1.5000 + 0.8660i
-1.5000 - 0.8660i
The IDTF of the DFT of f(n) = [1 2 3] using ifft is given by:
1
2
3
************************************************************
Example 5.5
Create the script fi le DTFT_DFT that returns the magnitude and phase plots of DTFT as
well as DFT of the following discrete-time sequence:
f n
n
N
N
n
k
( )
cos
ϭ
ϭ
ϭ
Ϫ
3
16
0
1

 

 
∑
for
CRC_47760_CH005.indd 515
CRC_47760_CH005.indd 515
7/23/2008 1:47:32 PM
7/23/2008 1:47:32 PM
Précédent

- 526/708

Suivant