Professional Documents
Culture Documents
Discrete Fourier Transform
Discrete Fourier Transform
1. Introduction
The sampled discrete-time fourier transform (DTFT) of a finite length, discrete-time signal is
known as the discrete Fourier transform (DFT). The DFT contains a finite number of samples
equal to the number of samples N in the given signal. Computationally efficient algorithms for
implementing the DFT go by the generic name of fast Fourier transforms (FFTs). This chapter
describes the DFT and its properties, and its relationship to DTFT.
-jwn
x (n)e
(1)
n-0
Let us sample X using a total of N equally spaced samples in the range : (0,2),
sampling interval is 2 That is, we sample X() using the frequencies.
N
= k = 2k , 0 k N-1.
N-1
-jwn
Thus
X (k) =
x (n)e
n-0
N-1
X (k) =
n-0
- j2kn
x (n)e
N
so
the
(2)
(2)
x(w)
n=0
The complex quantity Wn is periodic with a period equal to N. That is,
WNa+N = e-j+2/N(a+N) = e-j2 /N n = WNa where a is any integer.
Figs. 0.2(a) and (b) shows the sequence
odd respectively.
6
5
7
0
3
1
2
(a)
0
3
1
2
(b)
Fig.2 The Sequence for even N (b) The sequence for odd N.
The sequence WkNN for 0 n N-1 lies on a circle of unit radius in the complex plane
and the phases are equally spaced, beginning at zero.
The formula given in the lemma to follow is a useful tool in deriving and analyzing
various DFT oriented results.
2.1. Lemma
N-1
Wkn = N (k) = { N, k = 0
n-0 N
(3)
0, k 0
Proof :
N-1
an = 1 - aN : a 1
n-0
1-a
We know that
Applying the above result to the left side of equation (3.3), we get
N-1
(WkN) n = 1- WkNN
n= 0
1- WkNN
1- e-j2 kNN
1- e-j2 kNN
1- 1
1- e- j2 kNN
0, k 0
: k 0
N-1
WN0xn =
n= 0
1=N
n =0
N-1
N, k = 0
WN0xn =
0, k 0
n=0
= N (k), 0 k N-1
2.2 Inverse DFT
The DFT values (X(k), 0 k N-1), uniquely define the sequence x(n) through the inverse DFT
formula (IDFT) :
N-1
x (n) = IDFT (X(k) = 1 X(k) WN-kn , 0 k N-1
N k=0
The above equation is known as the synthesis equation.
N-1
N-1 N-1
Proof :
] = WN-kn
1 x(m) WN-(n-m)k
N k=0
m=0
WN(n-m)k
N, n=m
0, n m
Hence,
N-1
1
N
x(m) N (n-m)
= 1 x Nx (m)
N
m=n
( sifting property)
= x(n)
2.3 Periodicity of X (k) and x (n)
The N-point DFT and N-point IDFT are implicit period N. Even though x (n) and X (k) are
sequences of length N each, they can be shown to be periodic with a period N because the
exponentials WNkn in the defining equations of DFT and IDFT are periodic with a period N. For
this reason, x (n) and X (k) are called implicit periodic sequences. We reiterate the fact that for
finite length sequences in DFT and IDFT analysis periodicity means implicit periodicity. This
can be proved as follows :
N-1
X (k) = x(n) WNkn
N-p=0
x(n) WN-kn
n=0
= X (k)
N-1
Similarly,
x (n)
X (k) WN-kn
k=0
N-1
N-1
= 1 X(k) WN-kn WN -kn
N k=0
W87
W84
1.0
W83
Re(z)
W81
W82
Fig. 3 Sequence W80 for 0 n 8.
= e -j/4 = 1 j 1
2 2
-j/2
=e
=j
= e -j3/4 = 1 j 1
2 2
0
= -W8 = -1
Please note the periodic property : WNa = WNa+N where a is any integer.
Example 2 : Compute the DFT of the sequence defined by x (n) = (-1) n for
a. = N= 3
b. N = 4,
c. N odd,
d. N even.
Solution
X (k) = DFT (x-n)
N-1
=
(-1)n WNnk
n-0
N-1
(-1)n [WNk] n
n=0
= 1 (1)N
for W k -1
N
1+ WNk
a. N = 3
X(k) =
2
1+ WNk
2
1+ cos (2k/3) j sin ((2k/3)
0 k 2
b. N = 4
X (k) = 0 for W4k -1 or k 2
With k = 2 we get
N-1
X(2) (-1)n W42n
n=0
= 1 - W42 + W44 - W46
= 1 (-1) + (-1)2 (-1)2 = 4
Hence,
X (k) = 48(k-2)
c. We know that
W42n e-j2 / N k
If
N = 2k,
we get WNk= -1.
Since N is odd no k exists. This means to say that WNk -1 for all k from 0 to N-1.
Therefore,
X(k) =
2
0 k N-1
k
1+ WN
d. N even WNk = - 1, if k = N/2.
X ( k) = 0
for k N/2
With k = 2, we get
N-1
And x (N/2) = [- WNk] n
n=0
N-1
= [1] = N
n=0
Hence X (k) = N (k-N/2)
Solution
x (n) = IDFT (X(k))
N-1
1
x(n) WN-kn , 0 n N -1
N n=0
Please note that :
WN-kn = [ WNkn]*
Since, N = 4, we get
N-1
X(k) W4-kn , 0 n 3
x (n) = 1
4 n=0
= 1 [X(0) W4-0xn + X(1) W4-n + X (2) W4-2n + X (3) W4-3n]
4
= 1 [2 + (1+j) W4-n +0 + (1-j) + X (3) W4-3n]
4
Hence, x (0) = 1 [2 + (1+j) +(1-j)] = 1
4
= 1 [2 + (1+j) W4-1 +(1-j) W4-3] = 1
4
x (2) = 1 [2 + (1+j) W4-2 +(1-j) W4-6] = 1
4
Because of periodicity, W4-6 = W4-2
Hence,
x (2) = 1 [2 + (1+j) (-1) + (1-j) (-1)] = 0
4
x (1)
Hence,
x (3)
Hence,
n=0
Let us evaluate X (k) for different values of k in the range (0, N-1) as given below :
X (0) = WN0 x (0) + WN0 x (1) + + WN0 x (N-1)
X (1) = WN0 x (0) + WN1 x (1) + + WN(N-1) x (N-1)
X (2) = WN0 x (0) + WN2 x (1) + + WN2(N-1) x (N-1)
X (N-1) = WN0 x (0) + WN(N-1)x (1) + .. =+ WN(N-1) (N-1) x (N-1)
Putting the N DFT equations in N unknowns in the matrix form, we get
X = W Nx
Here X and x are (N x 1) matrices, and Wn is an (N x N) square matrix called the DFT matrix.
The full matrix form is described by
X(0)
W N0
W N0
W N0
W N0
x(0)
X(1)
W N0
W N1
W N2
WN(N-1)
x(1)
WNkn
:
WN(N-1)(N-1)
x(2)
X(2)
:
X(N-1)
W N0 W N2 W N4
:
:
:
0
N-1
WN WN
WN2(N-1)
:
x(N-1)
The elements WNkn of WN are called complex basis functions or twiddle factors.
Example : Compute the 4-point DFT of the sequence, x(n) = (1,2,1,0).
Solution
With N = 4, W4 = e-j2 /4 = -j.
We know that
X = WN x
X(0)
X(1)
X(2)
X(3)
W 40 W 40
W 40 W 41
W 40 W 42
W 40 W 43
W 40
W 42
W 44
W 46
W 40
W 43
W 46
W 40
x(0)
x(1)
x(2)
x(3)
Exploiting the periodic property WN0 = WNn+N where a is any integer the above matrix relation
becomes.
X(0)
X(1)
X(2)
X(3)
X(0)
X(1)
X(2)
X(3)
W 40 W 40
W 40 W 41
W 40 W 42
W 40 W 43
W 40
W42
W 40
W 42
W 40
W 43
W 42
W 41
1
1
1
1
1
-1
1
-1
1
j
-1
-j
1
-j
-1
j
x(0)
x(1)
x(2)
x(3)
1
2
1
0
Hence,
X(k) = (4, -j2, 0, j2)
Or
WN-1X = x
x = WN-1X
N-1
X (n) = 1 X(k) W ,
N k=0
0 n N-1
N-1
= 1 X (k) [WNkn ]*
N
k=0
The first set of N IDFT equation in N unknowns may be expressed in the matrix form as
x = 1 W*NX
N
Where W*N denotes the complex conjugate of WN. Comparision of equation (3.8) and (3.9)
leads us to conclude that
WN-1 = 1/N W*N
This very important result shows that W-1N requires only conjugation of Wn multiplied by 1/N.
an obvious computational advantage. The matrix relations (.7) and (.9) together define DFT as a
linear transformation.
Taking complex conjugates on both the sides of the above equation, we get
N-1
x*(n) =
1
N
k=0
X(k) WN-kn *
N-1
x*(n)
1
X*(k) WN-kn *
N k =0
(10)
The right hand side of equation (3.10) is recognized as the DFT of X* (k), so we can rewrite
equation (3.10) as follows :
x*(n) = 1 DFT (X*(k))
N
Taking complex conjugates on both the sides of equation (11), we get
x*(n) = 1 [DFT (X*(k))]
N
The above results suggests the DFT algorithm itself can be used to find IDFT. In practice, this is
indeed what is done.
6. Properties of DFT
In the following section, we shall discuss some of the important properties of the DFt. They are
strikingly similar to other frequency domain transforms, but must always be used in keeping with
implied periodicity for both DFT and IDFT in time and frequency domains.
6.1 Linearity
DFT (ax1(n) + bx2(n)j = aX1(k) + bX2(k),
k = 0, N =1
If X1(k) and X2(k) are the DFTs of the sequence x1 (n) and x2 (n), respectively, both of lengths
N.
Proof :
N-1
We know that
DFT [x(n)] =
x(n) WNkn
n=0
Letting x (n) = ax1(n) + bx2(n) we get
N-1
DFT = ax1(n) + bx2(n) = (ax1(n) +bx2 (n)] WNkn
n=0
N-1
= a x1(n) WNkn + b x1(n) WNkn
n=0
0 k N-1
W = e j /2
We know that,
W 40 = 1
Hence,
W 40 = 1
W41 = e = -j
W43 = e = -1
x1 (n) = cos ( /4 n )
Let
x2 (n) = sin ( /4 n )
and
Then, the values of x (n) and x2 (n) for 0 <n <3 tabulated below :
N
x1 (n) = cos ( /4 n )
0
1
2
3
1
1
2
0
-1
2
0
1
2
1
1
2
x2 (n) = sin ( /4 n )
k = 0,1,2,3
Hence,
Similarly,
2
2
X1 (0) = 1 + 1 1 = 1
2
2
1
X1 (1) = 1 + 1 W4 1 W43 = 1 j1.414
2
2
2
X1 (2) = 1 + 1 W4 1 W46
2
2
2
= 1 + 1 W4 1 W24 = 1
2
2
3
X1 (3) = 1 + 1 W4 1 W49
2
2
3
= 1 + 1 W4 1 W41
2
2
X2 (k) = DFT (x2 (n))
3
x2 (n) W4kn
n=0
k=0
It may be noted that the arrow, explicitly represents the position index of k = 0 or n = 0 of a
given sequence. The absence of this arrow also implicitly means that the first element in a
sequence always has the index k = 0 or n = 0.
Example Compute DFT (x(n)) of the sequence given below using the linearity property.
x (n) = cosh an,
0 n N-1
Solution
Given
0 n N-1
1 ean + 1 e-an
2
2
Applying linearity property, we get
= DFT
1 [ X (k) WN-kn
N k=0
0 n N-1
0 k N-1
N=1
x (n-m) = 1 [ X (k) WNk(n-m)
N k=0
Since, the time shift is circular, we can write the above equation as
N=1
x (n-m) = 1 [ X (k) WNkm ] WN-kn
N k=0
x (n-m)N = IDFt [ X(k) WNkm]
or DFT [x(n-m) N ] = WNkm X (k)
In terms of the transform pair, we can write the above equation is
DFT
x (n-m)N WNkm X (k)
Example Find the 4- point DFT of the sequence, x(n) = (1, -1, 1, -1) Also, using time shift
property, find the DFT of the sequence, y(n) = x (n-2)4.
Solution
Given N = 4
We know that
W40= 1,
W41= -j
W42 = -1,
W 43 = j
X (k) = DFT (x (n) )
Hence,
3
Given
0 k 3
= x(n) W4kn ,
n=0
= 1 W40k x 1 x W4k +1 x W42k - 1 x W43k
= 1- W41+W42k - W43k
X(0) = 1 -1 +1 -1 = 0
X(1) = 1 - W41+ W42- W43 = 0
X(2) = 1 - W42 + W44 - W46
= 1- W42+ W40 - W42 = 4
X(3) = 1 - W43 + W46- W49
= 1- W43 + W42- W41= 0
y (n) = x(n-2) 4
k-0
Hence,
4
2
6 7
1
0
x(n)
4
-1
Fig. Sequence x(n)
Solution
We may write
W32k = e-j2/3nx2k
= e-j2/3nx2k
Hence,
W32k = W64k
It is given in the problem that
Y(k) = W3 j2k X(k)
Y(k) = W64k X(k)
We know that DFT (x(n=m) N = WNmk X(k)
IDFT WNmk X(k) = x(n-m) N
Hence,
y(n) = x(n-4)6
Since,
x(n) = (1,-1,2,3,0,0)
We get x(n-4) is by moving the last 4 samples of x(n) to the beginning
y(n) = x(n-4) 6
= (2,3,0,0,1-1)
0 k N-1
n=0
N-1
X(k-1) =
x(n) WN(k-1)n
Since, the shift is frequency is circular, we may write the above equation as
N-1
X(k-1)8 =
n=0
Hence, DFT {x(n) WN-ln } = X (k=1)N
Example Compute the 4-point DFT of the sequence x (n) = (1,0,1,0), Also, find y (n) if Y (k) =
X (k-2) 4.
Solution
Given N = 4.
Also W40 = 1, W4l =-j, W42 =-1, W43 =j,
The DFT of the sequence, x (n) is
3
X(k) = x(n) W4kn , 0 k 3
= 1x W40k + 0+1 x W42k =0
= 1 +W42k
X(0) = 1+1= 2
X(1) = 1+W2 = 0
4
X(2) = 1+W04 = 2
X(3) = 1+W24 = 0
X(0) = 1+1= 2
X(k) = X(k-2))4
Given
Y(k) = X(k-2) 4
Hence,
y(n) = (1,0,1,0)
n=0
Circular convolution
Unlike DFT convolution in DFT in circular consider two sequence x(n) and y(n) the
circular convolution of x(n) and y(n) in given by
x(m) h(n-m) n
n=0
Point to be noted here in that x(n) and y(n) should be of same length
Example :
Let x (n) = 1,1,1
y (n) = 1,-2,2
Retain x (n) as it is and circularly fold y (n) i.e. y(n) = 1,2,-2.
N
0
1
2
x(m)
1,1,1
1,1,1
1,1,1
y(n-m)N
1,2,-2
-2,1,2
2,-2,1
h (n) = 1,1,1
f(n)
1 x 1+1x2+1x-2 = 1
1 x -2 + 1x1 + 1x2 = 1
1 x 2, +1x-2 + 1x1 = 1
Summary
N-1
1) x (k) = x(n) e-jwn
n=0
N-1
= x(n) Wnkn
n=0
N-1
2) x (n) = 1 x(n) Wnkn
N k=0
0 n N-1
3) Periodicity of Wnkn
W
W
6
8
7
8
W
=W
6
1
5
W = -W
8
8
-W78= W38
W
+N
=W
N
N
8
8
=W 8