DFT and FFT in Digital Signal Processing
DFT and FFT in Digital Signal Processing
5.1 Introduction
The Discrete Time Fourier Transform (DTFT) discussed in Chapter 4, provides a method to represent
a discrete time signal in frequency domain and to perform frequency analysis of discrete time signal.
The drawback in DTFT is that the frequency domain representation of a discrete time signal obtained
using DTFT will be a continuous function of w and so it cannot be processed by digital system. The discrete
Fourier transform (DFT) has been developed to convert a continuous function of w to a discrete function of
w, so that frequency analysis of discrete time signals can be performed on a digital system.
Basically, the DFT of a discrete time signal is obtained by sampling the DTFT of the signal at N uniform
frequency intervals and the number of samples (i.e., value of N) should be sufficient to avoid aliasing of
frequency spectrum. The samples of DTFT are represented as a function of integer k, and so the DFT is a
sequence consisting of N complex numbers represented as X(k) for k = 0,1,2,3,...... (N – 1).
Since X(k) is a sequence consisting of complex numbers, the magnitude and phase of each sample can
be computed and listed as magnitude sequence and phase sequence respectively. The graphical plots of
magnitude and phase as a function of k are also drawn.
The plot of magnitude versus k is called magnitude spectrum and the plot of phase versus k is called
phase spectrum. In general, these plots are called frequency spectrum.
The drawback in DFT is that the computation of each sample of DFT involves a large number of
calculations and when large number of samples are required, the number of calculations will further increase.
In order to overcome this drawback, a number of methods or algorithms have been developed to reduce the
number of calculations. The various methods developed to compute DFT with reduced number of calculations
are collectively called Fast Fourier Transform (FFT).
Chapter 5- Discrete Fourier Transform (DFT) and Fast Fourier Transform (FFT) 5. 2
Since X(k) is a sequence consisting of N-complex numbers for k = 0, 1, 2, ...... N-1, the DFT of x(n) can
be expressed as a sequence as shown below.
l
X( k ) = X(0), X(1), X(2),................ X( N − 1) q
5. 3 Digital Signal Processing
5.2.3 Frequency Spectrum Using DFT
The X(k) is a discrete function of frequency of discrete time signal w, and so it is also called discrete
frequency spectrum (or signal spectrum) of the discrete time signal x(n).
The X(k) is a complex valued function of k and so it can be expressed in rectangular form as,
X(k) = Xr(k) + jXi(k)
where, Xr(k) = Real part of X(k)
Xi(k) = Imaginary part of X(k)
Now the Magnitude function (or Magnitude spectrum) |X(k)| is defined as,
|X(k)|2 = X(k) X*(k) or X(k) = X(k) X* (k)
where X*(k) is complex conjugate of X(k)
2
Alternatively, X(k) = X(k) X* (k) = Xr ( k ) + jXi ( k ) X r ( k ) − jXi ( k )
= X2r ( k ) + Xi2 ( k )
N X (k) Q
r
Since X(k) is a sequence consisting of N-complex numbers for k = 0, 1, 2, ......... N-1, the magnitude and
phase spectrum of X(k) can be expressed as a sequence as shown below.
Magnitude sequence, X(k) = X(0) , n X(1) , X(2) ,................ s
X(N − 1)
l
Phase sequence, ∠X(k) = ∠X(0), ∠X(1), ∠X(2),................ ∠X(N −1)q
The magnitude and phase sequence can be sketched graphically as a function of k.
The plot of samples of magnitude sequence versus k is called magnitude spectrum and the plot of
samples of phase sequence versus k is called phase spectrum. In general, these plots are called frequency
spectrum.
5.2.4 Inverse DFT
Let, x(n) = Discrete time signal
X(k) = N-point DFT of x(n)
The inverse DFT of the sequence X(k) of length N is defined as,
N −1 j2 πkn
1
x(n) =
N ∑
k=0
X(k) e N ; for n = 0, 1, ....., N − 1 .....(5.3)
N −1 − j2 πkn
X 2(k) = DFT {x 2(n)} = ∑ x 2(n) e N .....(5.5)
n=0
N −1 − j2πkn
DFT {a1 x1(n) + a2 x 2(n)} = ∑ a1 x1(n) + a2 x 2 (n) e N
n=0
N −1 − j2 πkn N −1 − j2 πkn
= a1 ∑ x1(n)e N + a2 ∑ x (n) e
2
N
n=0 n=0
2. Periodicity
If a sequence x(n) is periodic with periodicity of N samples then N-point DFT, X(k) is also periodic with
a periodicity of N samples.
Hence, if x(n) and X(k) are N point DFT pair then,
x(n + N) = x(n) ; for all n
X( k + N) = X(k) ; for all k
Proof :
n=0 n=0
N−1 − j2πn k N−1 − j2 πn k
= ∑ x(n) e N e− j2πn = ∑ x(n) e N for integer n, e− j2πn = 1
n=0 n=0
= X(k ) Using definition of DFT.
5. 5 Digital Signal Processing
3. Circular time shift
The circular time shift property of DFT says that if a discrete time signal is circularly shifted in time
− j2 πkm
by m units then its DFT is multiplied by e N .
2 π km
−j
l q l
i. e., if , DFT x(n) = X(k), then DFT x(( n − m)) N = X(k) e q N
Proof :
m
DFT x((n − m))N r= n=0
∑ x((n − m))N e N = ∑
p=0
x(p) e N
Let, p = n m, \ n = p + m
N−1 − j2πkp − j2 πkm
= ∑ x(p) e N e N
p=0
LM
N−1 − j2πkp OP e − j2 πkm
MN ∑
= x(p) e N N
p=0 PQ
− j2πkm
= X( k) e N Using definition of DFT.
4. Time reversal
The time reversal property of DFT says that reversing the N-point sequence in time is equivalent to
reversing the DFT sequence.
i.e., if, DFT{x(n)} = X(k), then DFT{x (N-n)} = X(N-k).
Proof :
5. Conjugation
Let x(n) be a complex N-point discrete sequence and x*(n) be its conjugate sequence.
Now if, DFT{x(n)} = X(k), then DFT{x*(n)} = X*(N–k).
Chapter 5- Discrete Fourier Transform (DFT) and Fast Fourier Transform (FFT) 5. 6
Proof :
N−1 − j2 πkn LM x(n) e OP
N−1 j2 πkn
∗
o
DFT x∗(n) t = ∑
n=0
x∗( n) e N =
n=0MN ∑ PQ
N
LM x(n) e
N−1 j2 πkn OP = LM x(n) e
∗
N−1 j2 πkn − j 2 πnN OP ∗
MN ∑ e− j2π n
PQ MN ∑
= N N e N ej2pn = 1
n=0 n=0 PQ
L N−1
= M ∑ x( n) e
− j2πn( N − k )
N
∗
OP = X(N − k) = X∗(N − k)
∗
Using definition of DFT.
MN n=0 PQ
6. Circular frequency shift
The circular frequency shift property of DFT says that if a discrete time signal is multiplied by
j2 πmn
e N its DFT is circularly shifted by m units.
R| j2 π m n U|
l q
i.e., if, DFT x(n) = X(k) then DFT x(n) e S| N
V| = X((k − m)) N
T W
Proof :
R| j2 πmn U| = x(n) e
N−1 j2πmn − j2πkn
S|
DFT x( n) e N
V| ∑ N e N
T W n=0
N−1 − j2 π( k − m) n
= ∑ x( n) e N
n=0
7. Multiplication
The multiplication property of DFT says that the DFT of product of two discrete time sequences is
equivalent to circular convolution of the DFTs of the individual sequences scaled by a factor 1/N.
1
i.e., if, DFT {x(n)} = X(k), then DFT x1 (n) x2 (n) = m r X (k) * X2 (k)
N 1
Proof :
1
N−1 j2 πkn
1
N −1 j2 πmn Let, k = m
By definition of inverse DFT, x1(n) =
N
∑ X1(k) e N =
N
∑ X1(m) e N .....(5.6)
k=0 m=0
By definition of DFT,
N −1 − j2 πkn N−1L1 N−1 j2 πmn OP − j2 πkn
DFT {x1(n) x 2 (n)} = ∑ x1(n) x2 (n) e N = ∑ MM N ∑ X1(m) e N
PQ x (n) Using
e 2
N
1
= X1(k) ∗ X 2(k)
N Using definition of circular convolution.
5. 7 Digital Signal Processing
8. Circular convolution
The circular convolution of two N-point sequences x1(n) and x2(n) is defined as,
N −1
x1 ( n) ∗ x 2 ( n) = ∑ x1 ( m) x 2 (( n − m)) N Refer equation (2.57) of Chapter 2.
m= 0
The convolution property of DFT says that, the DFT of circular convolution of two sequences is
equivalent to product of their individual DFTs.
Let, DFT{x1(n)} = X1(k) and DFT{x2(n)} = X2(k), then by convolution property,
DFT{x1(n) * x2(n)} = X1(k) X2(k)
Proof :
Consider the product X1(k) X 2(k). The inverse DFT of the product is given by,
N−1 j2πnk
1
DFT −1{X1(k) X 2(k)} =
N
∑ X1(k) X 2 (k) e N
k=0
j2 πk(n − m − p)
1 N−1 N−1 N−1
=
Nm=0
∑
x1(m) x 2(p) ∑ ∑ e N .....(5.9)
p=0 k=0
N-1 j2 πk(n − m − p)
Consider the summation ∑ e N in equation (5.9).
k=0
Let, n − m − p = qN, where q is an integer. Since q is an
integer, e j2p q =1.
N−1 j2 πk(n − m − p) N−1 j2 πkqN N−1 N−1
k
∴ ∑
k=0
e N = ∑
k=0
e N = ∑
k=0
ee j = ∑ 1
j2πq
k=0
k
=N .....(5.10)
N-1
Consider the summation ∑
p=0
x 2 (p) in equation (5.9).
Since, n − m − p = qN, p = n − m − qN
N−1 N−1 N−1 N−1
∴ ∑ x (p)
p=0
2 = ∑ x (n − m − qN) = ∑ x (n − m, mod N) = ∑ x ((n − m))
m=0
2
m=0
2
m=0
2 N .....(5.11)
Using equations (5.10) and (5.11), the equation (5.9) can be written as shown below.
N−1 N−1 N−1
1
DFT −1{X1(k) X 2 (k)} =
N m=0
∑ x (m) ∑ x ((n − m))
1
m=0
2 N N= ∑ x (m) x ((n − m))
m=0
1 2 N
= x1(n) ∗ x 2 (n)
Using definition of circular convolution.
∴ X1(k) X 2 (k) = DFT { x1(n) ∗ x 2(n)}
Chapter 5- Discrete Fourier Transform (DFT) and Fast Fourier Transform (FFT) 5. 8
9. Circular correlation
The circular correlation of two sequences x(n) and y(n) is defined as,
N−1
rxy (m) = ∑ x(n) y∗ ((n − m)) N Refer equation (2.70) of Chapter 2.
n=0
Let, DFT{x (n)} = X(k) and DFT{y (n)} = Y(k), then by correlation property,
Consider the product X(k)Y * (k). The inverse DFT of the product is given by,
1 N−1 j2πnk
1 N−1 j2 πmk Let, n = m
DFT −1 {X(k) Y * (k)} = ∑ X(k) Y * (k) e N = ∑ X(k) Y * (k) e N
N k=0 N k=0
N-1 j2πk(m − n + p)
Consider the summation ∑ e N in equation (5.14).
k=0
N-1
Consider the summation ∑
p=0
y∗(p) in equation (5.14).
.....(5.16)
Since, m − n + p = qN, p = n − m + qN
N−1 N−1 N−1 N−1
∴ ∑ y* (p) = ∑ y*(n − m + qN) = ∑ y* (n − m, mod N) = ∑ y* ((n − m))
p=0 n=0 n=0 n=0
N
Using equations (5.15) and (5.16), the equation (5.14) can be written as shown below.
N−1 N−1
1
DFT −1 {X(k) Y * (k)} = ∑ x(n) ∑ y* ((n − m)) N N
N n=0 n=0
N−1
= ∑ x(n) y* ((n − m))
n=0
N = rxy (m)
Proof :
Consider the right - hand side term of Parseval's relation. Using equation (5.17).
1 N−1
1 N−1 L N−1 OP * − j2 πnk
n= 0 j2 πk
N
Let us evaluate X(z) at N equally spaced points on unit circle, i.e., at z = e
j2πk j2π k
N N 2πk
Note : Since, e = 1 and ∠e = ,
N
j2π k
the term, z = e N , for k = 0,1,2,3.....N − 1
represents N equally spaced points on unit circle in z-plane.
N−1 N−1 − j2 πkn
∴ X( z) j2 πk
= ∑ x(n)z− n j2 πk = ∑ x(n) e N .....(5.19)
z=e N n=0 z=e N n=0
1
Multiplication x1(n) x2(n) X1 ( k ) ∗ X2 ( k )
N
N−1
Circular convolution x1 ( n) ∗ x2 ( n) = ∑ x1 ( m) x2 (( n − m)) N X1(k) X2(k)
m=0
N−1
Circular correlation rxy ( m) = ∑ x(n) y* ((n − m)) N X(k) Y*(k)
n=0
Symmetry of X ( k ) = X∗ ( N − k )
real signals x(n) is real
X r ( k ) = Xr ( N − k )
Xi ( k ) = − Xi ( N − k )
| X( k )| = | X( N − k )|
∠X ( k ) = − ∠X ( N − k )
The DFT supports only circular convolution and so, the linear convolution of equation (5.22) has to
be computed via circular convolution. If x(n) is N1-point sequence and h(n) is N2-point sequence then linear
convolution x(n) and h(n) will generate y(n) of size N1 + N2 - 1. Therefore in order to perform linear convolution
via circular convolution the x(n) and h(n) should be converted to N1 + N2 - 1 point sequences by appending
zeros. Now the circular convolution of N1 + N2 - 1 point sequences x(n) and h(n) will give same result as that
of linear convolution.
Let, x(n) be N1-point sequence and h(n) be N2-point sequence.
Let us convert x(n) and h(n) to N1+N2-1 point sequences.
Let, Y(k) = N1 + N2 - 1 point DFT of y(n)
X(k) = N1 + N2 - 1 point DFT of x(n)
H(k) = N1 + N2 - 1 point DFT of h(n)
Now by circular convolution theorem of DFT,
DFT{x(n) * h(n)} = X(k) H(k)
On taking inverse DFT of the above equation we get,
x(n) * h(n) = DFT –1{X(k) H(k)}
Since, x(n) * h(n) = y(n), the above equation can be written as,
y(n) = DFT –1{X(k) H(k)} .....(5.23)
From the equation (5.23), we can say that the output y(n) is given by the inverse DFT of the product
of X(k) and H(k). Hence to determine the response of an LTI discrete time system, first find
N1 + N2 - 1 point DFT of input x(n) to get X(k) and N1 + N2 - 1 point DFT of impulse response h(n) to get H(k),
then take inverse DFT of the product X(k) H(k).
Chapter 5- Discrete Fourier Transform (DFT) and Fast Fourier Transform (FFT) 5. 12
Example 5.1
Compute 4-point DFT and 8-point DFT of causal three sample sequence given by,
1
x(n) = ; 0 ≤ n ≤ 2
3
= 0 ; else
Show that DFT coefficients are samples of Fourier transform of x(n), (Refer example 4.6 of Chapter 4 for
Fourier transform).
Solution
By the definition of N-point DFT, the kth complex coefficient of X(k), for 0 £ k £ N 1, is given by,
N − 1 − j2πkn
X(k) = ∑ x(n) e N
n =0
a) 4-point DFT (\
\ N = 4)
4 −1 − j2πkn 2 − jπkn − jπk
X(k) = ∑ x(n) e 4 = ∑ x(n) e 2 = x(0) e0 + x(1) e 2 + x(2) e − jπk e±j q = cosq ± jsinq
n=0 n =0
− jπk
=
1 1
+ e 2 +
1 − jπk 1
e = 1+ cos
πk LM
− j sin
πk
+ cos πk jsin πk
OP
3 3 3 3 2 N 2 Q
For 4-point DFT, X(k) has to be evaluated for k = 0, 1, 2, 3.
1
When k = 0 ; X(0) = [1 + cos 0 − j sin 0 + cos 0 − j sin 0]
3
1
= (1 + 1 − j0 + 1 − j0) = 1 = 1∠0
3
When k = 1 ; X(1) =
1 LM
1 + cos
π
− j sin
π
+ cos π − j sin π
OP
3 N 2 2 Q
1 1 1
=
(1 + 0 − j − 1 − j0) = − j = ∠ − π / 2 = 0.333∠ − 0.5π
3 3 3
1
When k = 2 ; X(2) = 1 + cos π − j sin π + cos 2π − j sin 2π
3
1 1
= (1 − 1 − j0 + 1 − j0) = = 0.333∠0
3 3
When k = 3 ; X(3) =
1 LM
1 + cos
3π
− j sin
3π
+ cos 3π − j sin 3π
OP
3 N 2 2 Q
1 1 1
= (1 + 0 + j − 1 − j0) = j = ∠π / 2 = 0.333∠0.5π
3 3 3
\ The 4-point DFT sequence X(k) is given by,
When k = 1 ; X(1) =
1 LM
1 + cos
π
− j sin
π
+ cos
π
− j sin
π OP
3 N 4 4 2 2 Q
= 0.333 (1 + 0.707 − j0.707 + 0 − j1)
= 0.568 − j0.568 = 0.803∠ − 0.785 = 0.803∠ − 0.25π
0.785
1 LM 2π 2π 2π 2π OP × π = 0.25π
When k = 2 ; X(2) = 1 + cos − j sin + cos − j sin π
3 N 4 4 2 2 Q
= 0.333 (1 + 0 − j1 − 1 − j0)
= − j0.333 = 0.333∠ − π / 2 = 0.333∠ − 0.5π
When k = 3 ; X(3) =
1 LM
1 + cos
3π
− j sin
3π
+ cos
3π
− j sin
3π OP
3 N 4 4 2 2 Q
= 0.333 (1 − 0.707 − j0.707 + 0 + j1)
= 0.098 + j0.098 = 0.139∠ 0.785 = 0.139∠0.25π
When k = 4 ; X(4) =
1 LM
1 + cos
4π
− j sin
4π
+ cos
4π
− j sin
4π OP
3 N 4 4 2 2 Q
= 0.333 (1 − 1 − j0 + 1 − j0) = 0.333 = 0.333∠0
When k = 5 ; X(5) =
1 LM
1 + cos
5π
− j sin
5π
+ cos
5π
− j sin
5π OP
3 N 4 4 2 2 Q
= 0.333 (1 − 0.707 + j0.707 + 0 − j1)
= 0.098 − j0.098 = 0.139∠ − 0.785 = 0.139∠ − 0.25π
When k = 6 ; X(6) =
1 LM
1 + cos
6π
− j sin
6π
+ cos
6π
− j sin
6π OP
3 N 4 4 2 2 Q
= 0.333 (1 + 0 + j1 − 1 − j0)
= j0.333 = 0.333∠π / 2 = 0.333∠0.5π
When k = 7 ; X(7) =
1 LM
1 + cos
7π
− j sin
7π
+ cos
7π
− j sin
7π OP
3 N 4 4 2 2 Q Phase angles
= 0.333 (1 + 0.707 + j0.707 + 0 + j1) are in radians.
= 0.568 + j0.568 = 0.803∠0.785 = 0.803∠0.25π
0.50 π
0.8
0.25 π
0.6
0
1 2 3 4 K
0.4
−0.25π
0.2 −0.50π
0 −0.75 π
1 2 3 4 K
F ig 4 : P h a se sp e ctru m o f X (k) fo r N = 4 .
F ig 1 : M a g n itu d e sp ectru m o f X (k ) for N = 4 .
X(k) ∠X ( k )
0.75 π
0.50 π
0.25 π
0
1 2 3 4 5 6 7 8 K
−0.25π
−0.50π
−0.75 π
F ig 5 : P h a se sp e c tru m o f X (k ) fo r N = 8 .
X(k) ∠X ( k )
0.75π
0.50π
0.25π
0
1 2 3 4 5 6 7 8 10 11 12 13 14 15 16 K
−0.25π 9
−0.50π
−0.75 π
F ig 6 : P h a se sp ectrum o f X (k ) for N = 1 6 .
5. 15 Digital Signal Processing
Example 5.2
Compute the DFT of the sequence, x(n) = {0, 1, 2, 1}. Sketch the magnitude and phase spectrum.
Solution
The given signal x(n) is 4-point signal and so, let us compute 4-point DFT.
By the definition of DFT, the 4-point DFT is given by, e±j q = cosq ± jsinq
4 −1 − j2πkn 3 − jπkn
X(k) = ∑ x(n) e 4 = ∑ x(n) e 2
n = 0 n = 0
− jπk − j3πk − jπk − j3πk
= x(0) e0 + x(1) e 2 + x(2) e− jπk + x(3) e 2 = 0 + e 2 + 2 e− jπk + e 2
πk πk 3πk 3πk
= cos − jsin + 2(cos πk − j sin πk) + cos − j sin
2 2 2 2
=
FG cos πk
+ 2 cos πk + cos
3πk IJ FG
− j sin
πk
+ sin
3πk IJ sin πk = 0 for integer k
H 2 2 K H 2 2 K
When k = 0 ; X(0) = ( cos 0 + 2 cos 0 + cos 0) j (sin 0 + sin 0)
= (1 + 2 + 1) j (0 + 0) = 4 = 4Ð 0
When k = 1; X(1) =
FG cos π + 2 cosπ + cos
3π IJ FG
− j sin
π
+ sin
3π IJ
H 2 2 K H 2 2 K
= (0 − 2 + 0) − j (1 − 1) = 2 = 2∠180o = 2∠π
c
When k = 2 ; X(2) = cos π + 2 cos 2π + cos 3π − j(sin π + sin 3π) h
= ( −1 + 2 − 1) − j (0 + 0) = 0
When k = 3 ; X(3) =
FG cos 3π + 2 cos 3π + cos
9π IJ FG
− j sin
3π
+ sin
9π IJ
H 2 2 K H 2 2 K
= (0 − 2 + 0) − j( −1 + 1) = 2 = 2∠180o = 2∠π
\ X(k) = { 4 Ð 0, 2Ð p, 0, 2Ð p }
Magnitude Spectrum, |X(k)| = { 4, 2, 0, 2 }
Phase Spectrum, ÐX(k) = { 0, p, 0, p }
X(k) ∠X ( k )
π π
π
4
0.75π
3
2 0.5π
2
2
0.25π
1
0 1 2 3 0 1 2 3
k k
F ig 1 : M a g n itu d e S p e ctru m . F ig 2 : P h a se S pe ctru m .
Chapter 5- Discrete Fourier Transform (DFT) and Fast Fourier Transform (FFT) 5. 16
Example 5.3
Compute circular convolution of the following two sequences using DFT.
x1(n) = { 0, 1, 0, 1 } and x2(n) = { 1, 2, 1, 2 }
- -
Solution
Given that, x1(n) = { 0, 1, 0, 1 }. The 4-point DFT of x1(n) is,
4 −1 − j2πnk 3 − jπnk
l
DFT x1(n) q = X1(k) = ∑ x1(n) e 4 = ∑ x1(n) e 2 ; k = 0, 1, 2, 3
n = 0 n = 0
πk 3πk
−j −j
= x1(0) e0 + x1(1) e 2 + x1(2) e− jπk + x1(3) e 2
πk 3πk πk 3πk
−j −j −j −j
= 0 + e 2 + 0 + e 2 = e 2 +e 2
When k = 0 ; X1(0) = e0 + e0 = 1 + 1 = 2
− jπ − j3π e±j q = cosq ± jsinq
When k = 1 ; X1(1) = e 2 + e 2 = −j + j = 0
− jπ − j3π
When k = 2 ; X1(2) = e + e = − 1 − 1 = −2
− j3π − j9π
When k = 3 ; X1(3) = e 2 + e 2 = j − j= 0
− jπk − j3πk
= 1 + 2e 2 + e− jπk + 2 e 2
X1(k) =
|S 0 ; k = 1
X2 (k) =
|S 0 ; k = 1
||−2 ; k = 2 ||−2 ; k = 2
|T 0 ; k = 3 |T 0 ; k = 3
Let, X3(k) be the product of X1(k) and X2(k).
\ X3(k) = X1(k) X2(k)
∴ X3 (k ) = m 12, 0, 4, 0 r
5. 17 Digital Signal Processing
By circular convolution theorem of DFT, we get,
DFT {x1(n) * x2(n)} = X1(k) X2(k) Þ x1(n) * x2(n) = DFT-1 { X1(k) X2(k) } = DFT-1 { X3(k) }
Let x3(n) be the 4-point sequence obtained by taking inverse DFT of X3(k).
4 −1 j2πnk 3 jπnk
1 1 1
DFT − mX (k)r
3 = x3(n) = ∑ X3 (k) e 4 = ∑ X3(k) e 2 ; n = 0, 1, 2, 3
4 k = 0
4 k = 0
=
1 LM
X3 (0) e0 + X3(1) e
jπn
2 + X3(2) e jπn + X3(3) e
j3πn
2
OP sin πn = 0
4 MN PQ for integer n
1
= 12 + 0 + 4e jπn + 0 = 3 + e jπn = 3 + cos πn + j sin πn = 3 + cos πn
4
When n = 0 ; x 3(0) = 3 + cos 0 = 3 + 1 = 4
When n = 1 ; x 3(1) = 3 + cos π = 3 − 1 = 2
When n = 2 ; x3 (2) = 3 + cos 2π = 3 + 1 = 4
When n = 3 ; x 3 (3) = 3 + cos 3π = 3 − 1 = 2
∴ x1(n) ∗ x 2 (n) = x3 (n) = l4, 2, 4, 2q
-
Example 5.4
Compute linear and circular convolution of the following two sequences using DFT.
x(n) = {1, 2 } and h(n) = { 2, 1 }
- -
Solution
Linear Convolution by DFT
The linear convolution of x(n) and h(n) will produce a 3 sample sequence. To avoid time aliasing let us
convert the 2 sample input sequences into 3-sample sequences by padding with zeros.
∴ x(n) = 1, 2, 0l q and h(n) = l2, 1, 0q
- -
By the definition of N-point DFT, the three point DFT of x(n) is,
3−1 − j2πkn − j2πk − j4 πk − j2πk
X(k) = ∑ x(n) e 3 = x(0) e0 + x(1) e 3 + x(2) e 3 = 1 + 2e 3
n = 0
When k = 0 ; X(0) = 1 + 2e0 = 1+ 2 = 3
− j 2π
When k = 1; X(1) = 1 + 2 e 3 = 1 + 2( −0.5 − j0.866) = − j1.732 e±jq = cosq ± jsinq
− j4 π
When k = 2; X(2) = 1 + 2 e 3 = 1 + 2( −0.5 + j0.866) = j1.732
By the definition of N-point DFT, the three point DFT of h(n) is,
3−1 − j2πkn − j2πk − j4 πk − j2πk
H(k) = ∑ h(n) e 3 = h(0) e0 + h(1) e 3 + h(2) e 3 = 2 + e 3
n = 0
When k = 0 ; H(0) = 2 + e0 = 2 + 1= 3
− j 2π
When k = 1; H(1) = 2 + e 3 = 2 − 0.5 − j0.866 = 1.5 − j0.866
− j4 π
When k = 2; H(2) = 2 + e 3 = 2 − 0.5 + j0.866 = 1.5 + j0.866
Chapter 5- Discrete Fourier Transform (DFT) and Fast Fourier Transform (FFT) 5. 18
Let, Y(k) = X(k) H(k) ; for k = 0, 1, 2
When k = 0 ; Y(0) = X(0) H(0) = 3 ´ 3 = 9
When k = 1 ; Y(1) = X(1) H(1) = ( j1.732) ´ (1.5j0.866) = 1.5 j2.598
When k = 2 ; Y(2) = X(2) H(2) = ( j1.732) ´ (1.5+j0.866) = 1.5 + j2.598
\ Y(k) = {9, 1.5 j2.598, 1.5 + j2.598}
-
The sequence y(n) is obtained from inverse DFT of Y(k). By definition of inverse DFT,
N − 1 j2πkn
1
y(n) = DFT −1 {Y(k)} = ∑ Y(k) e N ; for n = 0, 1, 2, ..... , N − 1
N k = 0
2 j2πkn
1
∴ y(n) =
3 ∑ Y(k) e 3
k = 0
1L OP
j2πn j4 πn
= MY(0) e +
3M
0
Y(1) e 3 + Y(2) e 3
PQ ; for n = 0, 1, 2
N
1L OP
j2πn j4πn
= M9 + (−1.5
3M
− j2.598) e 3 + (−1.5 + j2.598) e 3
PQ
N
j2πn j4 πn
= 3 + (−0.5 − j0.866) e 3 + (−0.5 + j0.866) e 3
When k = 0; H(0) = 2 + e0 = 2 + 1= 3
When k = 1; H(1) = 2 + e − jπ = 2 − 1 = 1
∴ H(k) = l3, 1q
-
Here, N = 2
1 j2πkn
1 1 1
∴ y(n) =
2
∑ Y(k) e
k =0
2 =
2
Y(0) + Y(1) e jπn =
2
9 − e jπn = 4.5 − 0.5e jπn
− j2 πk − j4 πk − j6 πk − j 2 ( N −1) πk
∴ X(k) = x(0) e0 + x(1)e N + x( 2) e N + x( 3) e N + ..... + x( N − 1) e N
123 14243 14243 14243 144424443
Complex Complex Complex Complex Complex
multiplication multiplication multiplication multiplication multiplication
1 444444444444444 424444444444444444 3
N − 1 Complex additions
4 4
4 (= 22) 12 16 4 ´ log222 =4 ´ 2 = 8 × log2 22 = × 2 = 4
2 2
8 8
8 (= 23) 56 64 8 ´ log223 = 8 ´ 3 = 24 × log2 23 = × 3 = 12
2 2
16 16
16 (= 24) 240 256 16 ´ log224 = 16 ´ 4 = 64 × log2 24 = × 4 = 32
2 2
32 32
32 (= 25) 992 1,024 32 ´ log225 = 32 ´ 5 = 160 × log2 25 = × 5 = 80
2 2
64 64
64 (= 26) 4,032 4,096 64 ´ log226 = 64 ´ 6 = 384 × log2 26 = × 6 = 192
2 2
128 128
128 (= 27) 16,256 16,384 128 ´ log227 = 128 ´ 7 = 896 × log2 27 = × 7 = 448
2 2
To simplify the notation it is desirable to define the complex valued phase factor WN (also called as
twiddle factor) which is an Nth root of unity as,
− j2π
WN = e N
Here, W represents a complex number 1Ð –2p. Hence the phase or argument of W is –2p. Therefore,
when a number is multiplied by W, only its phase changes by –2p but magnitude remains same.
− j2π
∴W = e
The phase value –2p of W can be multiplied by any integer and it is represented as prefix
in W. For example multiplying –2p by k can be represented as Wk.
− j2π × k
∴e ⇒ Wk
Chapter 5 - Discrete Fourier Transform (DFT) and Fast Fourier Transform (FFT) 5. 22
The phase value –2p of W can be divided by any integer and it is represented as suffix in W.
For example dividing –2p by N can be represented as WN.
1
− j2 π ×
− j2 π ÷ N N
∴e = e ⇒ WN
− j2 π n k nk
∴e N
e
= e − j2 π j N = WNnk .....(5.25)
The equation (5.26) is the definition of N-point DFT using phase factor, and this equation is popularly
used in FFT.
bg b g
∴ f1 n = x 2n ; for n = 0, 1, 2, 3 ....., N − 1
2
f b ng = xb2n + 1g
2 ; for n = 0, 1, 2, 3 ....., N −1
2
Let, X(k) = N-point DFT of x(n)
F1(k) = N/2 point DFT of f1(n)
F2(k) = N/2 point DFT of f2(n)
By definition of DFT the N/2 point DFT of f1(n) and f2(n) are given by,
N N
−1 −1
2 2
F1 (k) = ∑ f1(n) WNkn2 ; F2 (k) = ∑ f2 (n) WNkn2
n= 0 n= 0
Now, N-point DFT X(k), in terms of N/2 point DFTs F1(k) and F2(k) is given by,
k
X( k ) = F1 (k) + WN F2 (k) , where, k = 0, 1, 2, ....., N – 1 .....(5.27)
5. 23 Digital Signal Processing
The proof of equation (5.27) is given below.
Proof :
when n ® 2n, even numbered
By definition of DFT, the N-point DFT of x(n) is, samples of x(n) are selected.
N−1 when n ® 2n +1, odd numbered
X(k) = ∑ x(n) W kn
N
samples of x(n) are selected.
n=0
= ∑ x(n) W kn
N + ∑ x(n) WNkn ; k = 0, 1, 2 .....,N − 1
n = even n = odd
N N
−1 −1
2 2
= ∑ x(2n) WNk( 2n) + ∑ x(2n +1) W k( 2n +1)
N b g
..... 5.28
n= 0 n= 0
e
WNk( 2n) = e− j2π j N
k( 2n + 1)
e
= e− j2π j N/ 2
k2n
= W Nkn2
k kn k
.....(5.29)
Using equations (5.29) and (5.30), the equation (5.28) can be written as,
N N
−1 −1
2 2
kn kn k
X( k) = ∑ x(2n)
n= 0
WN 2 +
n= 0
∑ x(2n +1) W N2 W
N
x(2n) = f1(n) and x(2n+1) = f2(n)
N N
−1 −1
2 2
kn k kn
= ∑ f (n) W
n= 0
1 N2 + W
N ∑ f (n) W
n= 0
2 N2 .....(5.31)
By definition of DFT the N/2 point DFT of f1(n) and f2(n) are given by,
N N
−1 −1
2 2
F1(k) = ∑ f (n) W
1
kn
N2 and F2 (n) = ∑ f (n) W2
kn
N2 .....(5.32)
n= 0 n= 0
Having performed the decimation in time once, we can repeat the process for each of the sequences
f1(n) and f2(n). Thus f1(n) would result in the two N/4 point sequences and f2(n) would result in another two
N/4 point sequences.
Let the decimated N/4 point sequences of f1(n) be v11(n) and v12(n).
bg
Let, V11 k = N 4 point DFT of v11 n ; bg bg
V21 k = N 4 point DFT of v21 n bg
V12 bkg = N 4 point DFT of v b ng ; 12 V22 bkg = N 4 point DFT of v 22 b ng
Chapter 5 - Discrete Fourier Transform (DFT) and Fast Fourier Transform (FFT) 5. 24
x (0)
C om pute
x(4) 2-point D FT C om bine X (0)
2-point D FT s
to X (1)
get 4-point
x (2) C om pute D FT X (2)
2-point D FT C om bine
x (6)
4-point
X (3)
D FT s to
get 8-point
x (1) X (4)
C om pute D FT
2-point D FT C om bine
x (5) X (5)
2-point D FT s
to X (6)
get 4-point
x (3)
C om pute D FT
X (7)
x (7) 2-point D FT
The relations between the samples of various sequences are given below.
In the first stage of computation the two point DFTs of the 2-point sequences are computed.
b g ∑ v b ng W
V11 k = 11
nk
2 ; for k = 0, 1
n = 0, 1
0
When k = 0; V11 ( k ) = V11 (0) = v11 ( 0) W2 + v11 (1) W20 = v11 (0) + v11 (1) = x( 0) + x(4)
0
When k = 1; V11 ( k ) = V11 (1) = v11 ( 0) W2 + v11 (1) W21 = v11 ( 0) − W20 v11 (1) = x(0) − W20 x(4)
0 1
j2 π × − j2 π ×
W20 = e 2 = e0 = 1 W21 = e 2 = e − jπ = (cos π − j sin π) = − 1 = − 1 × W20 = − W20
0 0
When k = 0; V12 ( k ) = V12 (0) = v12 (0) W2 + v12 (1) W2 = v12 (0) + v12 (1) = x( 2) + x( 6)
0 0 0
When k = 1; V12 ( k ) = V12 (1) = v12 ( 0) W2 + v12 (1) W21 = v12 (0) − W2 v12 (1) = x(2) − W2 x(6)
Chapter 5 - Discrete Fourier Transform (DFT) and Fast Fourier Transform (FFT) 5. 26
Let, V21(k) =DFT{v21(n)}.
0
When k = 0; V21 ( k ) = V21 (0) = v21 ( 0) W2 + v21 (1) W20 = v21 (0) + v21 (1) = x(1) + x(5)
0
When k = 1; V21 ( k ) = V21(1) = v21 (0) W2 + v21 (1) W21 = v21 (0) − W20 v21(1) = x(1) − W20x(5)
0
When k = 0 ; V22 ( k ) = V22 (0) = v 22 ( 0) W2 + v22 (1) W20 = v22 ( 0) + v 22 (1) = x( 3) + x( 7)
0
When k = 1; V22 ( k ) = V22 (1) = v22 ( 0) W2 + v 22 (1) W21 = v22 ( 0) − W20 v 22 (1) = x( 3) − W20 x( 7)
In the second stage of computation the 4-point DFTs are computed using the results of first stage as
input. Let, F1(k) = DFT{f1(n)}. The 4-point DFT of f1(n) can be computed using equation (5.33).
∴ F1 (k) = V11 ( k ) + W4k V12 (k) ; for k = 0, 1, 2, 3. V11(k) and V12(k) are periodic
with periodicity of 2 samples.
When k = 0; F1 ( k ) = F1 (0) = V11 ( 0) + W40 V12 (0) \ V11(k + 2) = V11(k)
V12(k + 2) = V12(k)
When k = 1; F1 ( k ) = F1 (1) = V11 (1) + W41 V12 (1)
When k = 2; F1 ( k ) = F1 (2) = V11 ( 2) + W42 V12 (2) = V11 (0) − W40 V12 (0)
When k = 3; F1 ( k ) = F1 (3) = V11 ( 3) + W43 V12 (3) = V11 (1) − W41 V12 (1)
2
− j2 π ×
W42 = e 4 = e − jπ = (cos π − j sin π ) = −1 = −1 × W40 = − W40
3 2 1 1
− j2 π × − j2 π × − j2 π × − j2 π ×
W43 = e 4 =e 4 e 4 = e − jπ e 4 = (cos π − j sin π ) W41 = −1 × W41 = − W41
Let, F2(k) = DFT{f2(n)}. The 4-point DFT of f2(n) can be computed using equation (5.34).
∴ F2 (k) = V21 ( k ) + W4k V22 (k) ; for k = 0, 1, 2, 3. V21(k) and V22(k) are periodic
with periodicity of 2 samples.
When k = 0; F2 ( k ) = F2 (0) = V21 ( 0) + W40 V22 (0) \ V21(k + 2) = V21(k)
V22(k + 2) = V22(k)
When k = 1; F2 ( k ) = F2 (1) = V21 (1) + W41 V22 (1)
When k = 2; F2 ( k ) = F2 (2) = V21 ( 2) + W42 V22 (2) = V21 ( 0) − W40 V22 (0)
When k = 3; F2 ( k ) = F2 (3) = V21 ( 3) + W43 V22 (3) = V21 (1) − W41 V22 (1)
5. 27 Digital Signal Processing
Third Stage Computation
In the third stage of computation the 8-point DFTs are computed using the results of second stage as
inputs.
Let, X(k) = DFT{X(n)}. The 8-point DFT of x(n) can be computed using equation (5.27).
∴ X( k ) = F1 ( k ) + W8k F2 (k) ; for k = 0, 1, 2, 3, 4, 5, 6, 7 F1(k) and F2(k) are periodic with
periodicity of 4 samples.
When k = 0; X( k ) = X( 0) = F1 ( 0) + W80 F2 (0) \ F1(k + 4) = F1(k)
When k = 1; X( k ) = X(1) = F1 (1) + W81 F2 (1) F2(k + 4) = F2(k)
When k = 2; X( k ) = X( 2) = F1 ( 2) + W82 F2 ( 2)
When k = 3; X( k ) = X( 3) = F1 (3) + W83 F2 ( 3)
When k = 4; X( k ) = X( 4) = F1 ( 4) + W84 F2 (4) = F1 (0) − W80 F2 ( 0) − j2 π ×
4
W84 = e 8 = e − jπ
When k = 5; X( k ) = X(5) = F1 (5) + W85 F2 (5) = F1 (1) − W81 F2 (1)
= (cos π − j sin π)
When k = 6; X( k ) = X( 6) = F1 ( 6) + W86 F2 (6) = F1 (2) − W82 F2 ( 2)
= −1
When k = 7; X( k ) = X( 7) = F1 ( 7) + W87 F2 (7) = F1 (3) − W83 F2 ( 3)
W84 = W84 × W80 = − W80 W85 = W84 × W81 = − W81 W86 = W84 × W82 = − W82 W87 = W84 × W83 = −W83
5.7.2 Flow Graph for 8-Point DFT using Radix-2 DIT FFT
If we observe the basic computation performed at every stage of radix-2 DIT FFT in previous section,
we can arrive at the following conclusion.
1. In each computation two complex numbers "a" and "b" are considered.
1 1
x(0) x(0) + W 02 x(4) = V11(0)
1
1
W20
x(4) x(0) − W20 x(4) = V11(1)
−1
x(2) 1 1 x(2) + W20 x(6) = V12 (0)
1
1
W20
x(6) x(2) − W20 x(6) = V12 (1)
−1
1 1
x(1) x(1) + W20 x(5) = V21(0)
1
1
W20
x(5) x(1) − W20 x(5) = V21(1)
−1
1 1
x(3) x(3) + W20 x(7) = V22 (0)
1
W20 1
x(7) x(3) − W20 x(7) = V22 (1)
−1
W40 -1
1 0
V12(0) V11 0 − W4 V12 0 = F1 2
W41 -1 1
V12(1) V11 1 − W4 V12 1 = F1 3
1 1 0
V21(0) V21 0 + W4 V22 0 = F2 0
1
1 1 1
V21(1) V21 1 + W4 V22 1 = F2 1
1
W40 1
-1 0
V22(0) V21 0 − W4 V22 0 = F2 2
1
W41 -1 1
V22(1) V21 1 − W4 V22 1 = F2 3
1
1 1
F 1 (1) F1 (1) + W 8 F2 (1) = X (1)
1
1
1
F 1 (2) F1(2) + W 82 F 2 (2) = X (2)
1
1
1
F 1 (3) F1 (3) + W 83 F 2 (3) = X (3)
0 1
W 8
F 2 (0) F1(0) − W 80 F 2 (0) = X (4)
1
W 8 1
F 2 (1) F1 (1) − W 8 F2 (1) = X (5)
2
W 8
F 2 (2) F1(2) − W 82 F 2 (2) = X (6)
3
W8
F 2 (3) F1 (3) − W 83 F2 (3) = X (7)
The Combined Flow Graph (or Butterfly Diagram) of All the Three Stages of Computation
1 1 1 1 1 1
x (0) X (0)
1 1
0
W2 1 1
1 1 1
x (4) X (1)
−1 1 1
0
1 W4 1 1
1 −1 1
x (2) X (2)
1
1 1 1
0
W2 1 W4
1 1
x (6) X (3)
−1 −1
1
0
1 W8 1
1 1 1
x (1) X (4)
1 −1
0 1 1
W2 1 W8 1
1 1 −1
x (5) X (5)
−1 1
0 2
W4 1 W8 1 −1
1 1 −1
x (3) X (6)
0
1 3
1 1
W2 1 W4 −1 W8 1 −1
x (7) X (7)
−1
n=
2
N N N N
−1 −1 FG N IJ −1 −1
kN
∑ xFH n + N2 IK W FH IK
2 2 k n+ 2 2
H K x n + N WNkn WN2
= ∑ x(n) W
n=0
kn
N +
n=0
N
2
= ∑ x(n) W
n=0
kn
N + ∑
n=0
2
N N
−1 −1
n=0
N
2 Q n=0
N
N
n=0
2 Q
kn
N2 ∴ G1 k =b g ∑ g bng W 1
kn
N2 ; for k = 0, 1, 2,.. N 1
2
n=0
N
−1
2
= ∑ g (n) W
1
kn
N2 = G1(k)
n=0
5. 31 Digital Signal Processing
=
2
n=0N 2 Q N
N
−1
In the next stage of decimation the N/2 point frequency domain sequence G1(k) is decimated into two
numbers of N/4 point sequences D11(k) and D12(k), and G2(k) is decimated into two numbers of N/4 point
sequences D21(k) and D22(k).
Let D 11(k) and D12(k) be two numbers of N/4 point sequences obtained by the decimation of G1(k).
Let D11(k) be N/4 point DFT of d 11(n), and D12(k) be N/4 point DFT of d12(n).
Let D 21(k) and D22(k) be two numbers of N/4 point sequences obtained by the decimation of G2(k).
Let D21(k) be N/4 point DFT of d 21(n), and D22(k) be N/4 point DFT of d22(n).
Now, N/2 point DFTs can be obtained from two numbers of N/4 point DFTs as shown below.
G1(k)½k = even = D11(k)
G1(k)½k = odd = D12(k)
G2(k)½k = even = D21(k)
G2(k)½k = odd = D22(k)
Proof :
∑ g FH n + N4 IK W H FH IK
4 4 k n+ 4 4
= ∑ g (n) K g1 n + N W Nkn2 W N 42
k
n=0
1 W Nkn2 +
n=0
1 N2
4
= ∑
n=0
g1(n) W Nkn2 + ∑
n=0
4
N
L4
−1
O
kn
= ∑ Mg (n) + W g FH n + N IK P W
4 kn
kN
−j
2 π kN
W N2 = e N 2 = e − jπk
MN
n=0
1
4 PQ
N2 1 N2
k
N
−1
e j = b −1g
= e − jπ
k
= ∑ LMg (n) + g FH n + N IK OP W
4
= ∑ d (n) W kn
4
kn
= D11(k)
∴ D11(k) =
n=0
∑d 11(n) W Nkn4
N 1
4 Q 1 N4 11 N4
(n) = LMg b ng − g FH n + N IK OP W
n=0 n=0
n
d12
G1(k) k = odd = G1(2k + 1) ; for k = 0, 1, 2,....., N − 1
N 1 1
4 Q N2
4
D12(k) is N point DFT of d12(n).
N
−1 4
=
4
∑d 12(n) WNkn4
N N
−1 −1 n=0
=
4
∑ LMg (n) − g FH n + N IK OP W n
W Nkn4 =
4
d21(n) = g2(n) + g2 n + N FH IK
Similarly the N/2 point sequence G 2 (k) can be decimated 4
into two numbers of N/4 point sequences. D21(k) is N point DFT of d21(n).
4
G2(k) k = even = G2(2k) ; for k = 0, 1, 2, ....., N − 1 N
4
−1
4
N
4
−1
∴ D21(k) = d21(n) WNkn4 ∑
n=0
= ∑d 21(n) WNkn4 = D21(k)
LM
n=0
d22 (n) = g 2 (n) − g 2 n + N FH IK OP W n
N 4 Q N 2
The decimation of the frequency domain sequence can be continued until the resulting sequence are
reduced to 2-point sequences. The entire process of decimation involves, m stages of decimation where
m = log2N. The computation of the N-point DFT via the decimation in frequency FFT algorithm requires
(N/2)log2N complex multiplications and N log2N complex additions. (i.e., the total number of computations
remains same in both DIT and DIF).
5.8.1 8-point DFT Using Radix-2 DIF FFT
The DIF computations for an eight sequence is discussed in detail in this section. Let x(n) be an
8-point sequence. Therefore N = 8 = 23 = rm. Here, r = 2 and m = 3. Therefore, the computation of 8-point DFT
using radix-2 FFT involves three stages of computation.
The samples of x(n) are,
x(0), x(1), x(2), x(3), x(4), x(5), x(6), x(7)
First Stage Computation
In the first stage of computation, two numbers of 4-point sequences g1(n) and g2(n) are obtained from
x(n) as shown below.
LM
g1 (n) = x(n) + x n + N e jOQP = x(n) + x(n + 4) ;for n = 0, 1, 2, 3
N 2
5. 33 Digital Signal Processing
When n = 0; g1(n) = g1(0) = x(0) + x(4)
When n = 1; g1(n) = g1(1) = x(1) + x(5)
When n = 2; g1(n) = g1(2) = x(2) + x(6)
When n = 3; g1(n) = g1(3) = x(3) + x(7)
LM
g 2 (n) = x(n) – x n + N
e jOPQ Wn
= x(n) – x(n + 4) W8n ; for n = 0, 1, 2, 3
N 2 N
b g
d11 (n) = g1 (n) + g1 n + N 4 = g1 (n) + g1 (n + 2) ; for n = 0, 1
= d11 (0) W20 + d11 (1) W21 W20 = d11 (0) − d11 (1) W20
Similarly the 2-point DFTs of the 2-point sequences d12(n), d21(n) and d22(n) are computed and the
results are given below.
D11 ( 0) = d11 ( 0) + d11 (1)
D11 (1) = d11 ( 0) − d11 (1) W20
D12 (0) = d12 (0) + d12 (1)
D12 (1) = d12 (0) − d12 (1) W20
D21 (0) = d 21 (0) + d 21 (1)
D21 (1) = d 21 (0) − d 21 (1) W20
D22 (0) = d 22 (0) + d 22 (1)
D22 (1) = d 22 (0) − d 22 (1) W20
1. In each computation two complex numbers "a" and "b" are considered.
2. The sum of the two complex numbers is computed which forms a new complex number "A".
3. Then subtract complex number "b" from "a" to get the term "a-b". The difference term "a-b" is
multiplied with the phase factor or twiddle factor "WNk " to form a new complex number "B".
The above basic computation can be expressed by a signal flow graph shown in Fig 5.7. (For detailed
discussion on signal flow graph, refer Chapter 2, Section 2.6.2).
1 a+ b
A = a+ b
1
1 k
WN k
b B = ( a − b)W N
−1 a −b
1 1
x(0) x(0) + x(4) = g1(0)
1
1 1
x(1) x(1) + x(5) = g1(1)
1
1 1
x(2) x(2) + x(6) = g1(2)
1
1 1
x(3) x(3) + x(7) = g1(3)
1
1 0
W8
0
x(4) [x(0) − x(4)] W8 = g 2 (0)
−1
1 1
−1 W8
1
x(5) [x(1) − x(5)] W8 = g 2 (1)
1 2
−1 W8 2
x(6) [x(2) − x(6)] W8 = g 2 (2)
1 3
−1 W8
3
x(7) [x(3) − x(7)] W8 = g 2 (3)
1 1
g2(0) g2 0 + g2 2 = d 21 0
1
1 1
g2(1) g2 1 + g2 3 = d 21 1
1
1 0
W4
−1 [g2 0 − g2 2 ]W
0
= d 22 0
g2(2) 4
1 1
W4 1
g2(3) [g2 1 − g2 3 ]W = d 22 1
−1 4
1 0
W2
d 1 1(1) [d 11 (0) − d 11 (1)]W 20 = D 11 (1) = G 1(2) = X (4)
−1
1 1
d 1 2 (0) d 12 (0) + d 12 (1) = D 12 (0) = G 1 (1) = X (2)
1
1 0
W2
d 1 2 (1) 0
[d 12 (0) − d 1 2 (1)]W 2 = D 12 (1) = G 1(3) = X (6)
−1
1 1
d 2 1 (0) d 21 (0) + d 21 (1) = D 21 (0) = G 2 (0) = X (1)
1
1 0
W2
d 2 1 (1) [d 2 1(0) − d 21 (1)]W 20 = D 21 (1) = G 2 (2) = X (5)
−1
1 1
d 2 2 (0) d 2 2 (0) + d 22 (1) = D 2 2 (0) = G 2 (1) = X(3)
1
0
1 W2
d 2 2 (1) [d 2 2 (0) − d 22 (1)]W 20 = D 22 (1) = G 2 (3) = X (7)
−1
F − j2 πnk ∗I
1N 1
−
1N 1
−
∗ 1 LM Xbkg W
N−1
∗ O
=
Nk=0
X(k) e∑ GH N
JK = ∑ b g eWNnk j
N k=0
Xk =
N MN ∑ e
nk
N j PPQ .....(5.35)
k=0
Chapter 5 - Discrete Fourier Transform (DFT) and Fast Fourier Transform (FFT) 5. 38
In equation (5.35), the expression inside the bracket is similar to that of DFT computation of a
sequence, with following differences.
1. The summation index is k instead of n.
2. The input sequence is X(k) instead of x(n).
3. The phase factors are conjugate of the phase factor used for DFT.
Hence, in order to compute inverse DFT of X(k), the FFT algorithm can be used by taking the conjugate of
phase factors. Also from equation (5.35) it is observed that the output of FFT computation should be divided
by N to get x(n).
The following procedure can be followed to compute inverse DFT using FFT algorithm.
1. Take N-point frequency domain sequence X(k) as input sequence.
2. Compute FFT by using conjugate of phase factors.
3. Divide the output sequence obtained in FFT computation by N, to get the sequence x(n).
Thus a single FFT algorithm can be used for evaluation of both DFT and inverse DFT.
Example 5.5
An 8-point sequence is given by x(n) = {2, 1, 2, 1, 1, 2, 1, 2}. Compute 8-point DFT of x(n) by
a) radix-2 DIT-FFT and b) radix-2 DIF-FFT. Also sketch the magnitude and phase spectrum.
Solution
a) 8-point DFT by Radix-2 DIT-FFT
The given sequence is first arranged in the bit reversed order.
The sequence x(n) The sequence x(n) in
in normal order bit reversed order x (0) = 2 2+ 1= 3
= −j 1 1
-1 3 −3 = 0
3
1
−j -1
−1 −1 −( −1)( −j)= −1 −j
The phase factors involved in third stage computation are W80 , W81 , W82 and W83.
1
6 6 + 6 = 12 = X(0)
1− j
1 F 1 − j 1 I = 1− j − F
1 + j 1 + j 1 + 1 = 1 + j −1 + 2 I = 1 + j0 . 414 = X(1)
(1 − j) + (−1 + j) GH 2 2 JK 2 2 2 2
GH
2
JK
1 0 + 0 × ( −j) = 0 = X(2)
0
1 F I
(1 + j) + (−1 − j) − 1 − j 1 = 1 + j + 1 + j 1 + j 1 − 1 = 1 + j 1 + 2
F I = 1 + j2 . 414 = X(3)
1+j
2
GH 2
JK 2 2 2 2 2
GH JK
1
6 6 − 6 = 0 = X( 4)
1 −1
−j 1
2 2 F 1 − j 1 I = 1 − j − F− 1 +j 1 +j 1 + 1
I = 1 − jF1 + 2 I = 1 − j2 . 414 = X(5)
−1 + j
−1
(1 − j) − ( −1 + j) GH 2 2 JK GH 2 2 2 2
JK GH 2 JK
−j
0 0 − 0 × (−j) = 0 = X(6)
1 1 −1
− −j
2 2 1 1 1 +j 1 +j 1 − 1
−1− j (1 + j) − ( −1 − j) GH
− −j JK = 1+ j − GH JK = 1+ j 1− 2 GH JK = 1 − j0 . 414 = X(7)
−1 2 2 2 2 2 2 2
For 8-point DFT by radix-2 FFT we require 3-stages of computation with 4-butterfly computation in each
stage. The given sequence is the input to first stage. For other stages of computations, the output of previous stage
will be the input for current stage.
1 1
x(0) = 2 2+1= 3
1
1 1
x(1) = 1 1+ 2 = 3
1
1 1
x(2) = 2 2+1= 3
1
1 1
x(3) = 1 1+2 = 3
1
1 1
x(4) = 1 2 −1= 1
−1 1 1
−j
1 2 2 1 1 1 1
x(5) = 2
−1
(1 − 2) GH 2
−j
2
JK =−
2
+j
2
1 −j
x(6) = 1 (2 − 1)( −j) = −j
−1 1 1
1 − −j
2 2 1 1 1 1
x(7) = 2
−1 (1 − 2) − GH 2
−j
2
JK =
2
+j
2
= cos
FG −π IJ + j sin
FG −π IJ 3
−1 −j
(3 − 3) ( −j) = 0
H 2K H 2K 1 1
= −j 1 1 + ( −j) = 1 − j
1
1 1 1 1 1 1 1 1 2
−
2
+j
2 1 GH−
2
+j
2
JK + GH 2
+j
2
JK =j
2
1
−1 1
−j 1 − ( −j) = 1 + j
1
1 1
+j −1 −j 1 1 1 1 2
2 2 MNGH −
2
+j
2
JK − GH 2
+j
2
JKPQ ( − j) = j
2
2
1− j (1 − j) + j = 1 + j0.414 = X (1)
2
2 2
j (1 − j) − j = 1 − j2.414 = X (5)
2 2
1+ j 2
(1 + j) + j = 1 + j2.414 = X (3)
2
2 2
j (1 + j) − j = 1 − j0.414 = X (7)
2 2
F ig 6 : B u tte rfly d iag ra m fo r th ird stag e o f ra d ix -2 D IF F F T.
The output sequence of third stage of computation = { 12, 0, 0, 0, 1+j0.414, 1j2.414, 1+j2.414, 1j0.414 }
The output sequence of third stage of computation is the 8-point DFT of the given sequence in bit
reversed order.
In DIF-FFT algorithm the input to first stage is in normal order and the output of third stage will be in the
bit reversed order. Hence the actual result is obtained by arranging the output sequence of third stage in normal
order as shown below.
Chapter 5 - Discrete Fourier Transform (DFT) and Fast Fourier Transform (FFT) 5. 42
The sequence X(k) The sequence X(k)
in bit reversed order in normal order
X(0) = 12 X(0) = 12
X(4) = 0 X(1) = 1+ j0.414
X(2) = 0 X(2) = 0
X(6) = 0 X(3) = 1+ j2.414
X(1) = 1+ j0.414 X(4) = 0
X(5) = 1 j2.414 X(5) = 1 j2.414
X(3) = 1+ j2.414 X(6) = 0
X(7) = 1 j0.414 X(7) = 1 j0.414
Each element of the sequence X(k) is a complex number and they are expressed in rectangular coordinates.
If they are converted to polar coordinates then the magnitude and phase of each element can be obtained.
Note : The rectangular to polar conversion can be obtained by using R ® P conversion in calculator.
The magnitude specturm is the plot of the magnitude of each sample of X(k) as a function of k as shown
in fig 7. The phase spectrum is the plot of phase of X(k) as a function of k as shown in fig 8.
When N-point DFT is performed on a sequence x(n) then the DFT sequence X(k) will have a periodicity of
N. Hence in this example the magnitude and phase specturm will have a periodicity of 8 as shown in fig 7 and
fig 8.
X (k ) ∠X (k)
12
12
0.5π
0.37π 0.37π
0.25π
N=8 0.12π 0.12π
0
1 2 3 4 5 6 7 8 9 10 11
0.5π −0.12π
2.61 2.61 2.61
1.08 0.25π −0.37π
1.08 1.08
0 1 2 3 4 5 6 7 8 9 10 11 k
F ig 7 : M a gn itude sp ectrum . F ig 8 : P hase spectrum .
5. 43 Digital Signal Processing
Example 5.6
In an LTI system the input x(n) = {1, 2, 3} and the impulse response h(n) = {1, 1}. Determine the response
of the LTI system by radix-2 DIT FFT.
Solution
The response y(n) of LTI system is given by linear convolution of input x(n) and impulse response h(n).
\ Response or Output, y(n) = x(n) * h(n)
The DFT (or FFT) supports only circular convolution. Hence to get the result of linear convolution from
circular convolution, the sequences x(n) and h(n) should be converted to the size of y(n) by appending with zeros
and circular convolution of x(n) and h(n) is performed.
The length of x(n) is 3 and h(n) is 2. Hence the length of y(n) is 3 + 2 1 = 4. Therefore given sequences
x(n) and h(n) are converted to 4 point sequences by appending zeros.
\ x(n) = {1, 2, 3, 0} and h(n) = {1, 1, 0, 0}
Now the response y(n) is given by, y(n) = x(n) * h(n).
Let, DFT {x(n)} = X(k), DFT {h(n)} = H(k), DFT{y(n)} = Y(k).
By convolution theorem of DFT we get,
DFT {x(n) * h(n)} = X(k) H(k)
\ y(n) = DFT1{Y(k)} = DFT-1{X(k) H(k)}
The various steps in computing y(n) are,
Step - 1 : Determine X(k) using radix-2 DIT algorithm.
Step - 2 : Determine H(k) using radix-2 DIT algorithm.
Step - 3 : Determine the product X(k)H(k).
Step - 4 : Take inverse DFT of the product X(k)H(k) using radix-2 DIT algorithm.
Input sequence to first stage = { 1, 3, 2, 0 }. The butterfly computations of first stage are shown in fig1.
x (3) = 0 2 −0 = 2
F ig 1 : B u tterfly d ia gram fo r
first sta ge o f ra d ix -2 D IT F F T.
Output sequence of first stage of computation = { 4, -2, 2, 2 }
Chapter 5 - Discrete Fourier Transform (DFT) and Fast Fourier Transform (FFT) 5. 44
Second stage computation
Input sequence to second stage computation = { 4, -2, 2, 2 }
The phase factors involved in second stage computation are W40 and W41 .
The butterfly computations of second stage are shown in fig 2.
1 1 − j2π ×
0
4 4 + 2 = 6 = X (0)
1 W40 = e 4 =1
1 1 1 π
−2 −2 + 2( −j) = −2 − 2j = X (1) − j2π × −j ×
1 W41 = e 4 =e 2
1
1
2
-1 4 − 2 = 2 = X (2)
= cos
FG −π IJ + jsinFG −π IJ
2
−j
1
-1 −2 − 2( −j) = −2 + 2j = X (3)
H 2K H 2K
= −j
F ig 2 : B u tte rfly dia gra m fo r seco n d stag e o f ra d ix -2 D IT F F T.
h(3) = 0 −1 − 0 = −1
F ig 3 : B u tterfly d ia gram fo r
first sta g e o f ra dix -2 D IT FF T.
= cos
FG −π IJ + jsinFG −π IJ
H 2K H 2K
= −j
5. 45 Digital Signal Processing
1 1
−1 −1 + ( −1) = −2 = H (0)
1
1 1
−1 −1 + ( −1)( −j) = −1 + j = H (1)
1
1
1 -1
−1 −1 − ( −1) = 0 = H (2)
1
−j -1
−1 −1 − ( −1)( −j) = −1 −j = H (3)
Y (1) = 4 4+4=8
stage of computation is W20 . d i
0 ∗
Y (3) = 4 4 −4 = 0
Since, dW i
2 = 1, it is not
considered for computation.
F ig 5 : B u tterfly d iag ram fo r
first sta g e o f in v erse D F T o f Y (k).
The output sequence of first stage computation = { 12, 12, 8, 0}
−12
1 1
−12 + 8 = −4 = 4y(0)
dW i 0
4 =e 4 =1
1 π
1 1 ∗
j2π × j ×
−12
1 1
1
−12 + (0)(j) = −12 = 4y(1) dW i 4 = e 4 =e 2
W4
0 ∗
d i =1 1
-1 = cos
FG π IJ + jsinFG π IJ
8
1 ∗
−12 − 8 = −20 = 4y(2) H 2K H 2K
0
d i
W4 =j 1
-1
−12 − (0)(j) = −12 = 4y(3)
=j
Example 5.7
Determine the response of LTI system when the input sequence x(n) = {1, 2, 2, 2, 1} by radix 2 DIT FFT.
The impulse response of the system is h(n) = {1, 1, 1, 1}.
Solution
The response of an LTI system is given by linear convolution of input x(n) and impulse response h(n).
\ Response or Output, y(n) = x(n) * h(n).
The DFT (or FFT) supports only circular convolution. Hence to get the result of linear convolution from
circular convolution, the sequence x(n) and h(n) should be converted to the size of y(n), by appending with zeros,
and then circular convolution of x(n) and h(n) is performed.
The length of x(n) = 5, and h(n) = 4. Hence the length of y(n) is 5 + 4 1 = 8.
Therefore x(n) and h(n) are converted into 8-point sequence by appending zeros.
\ x(n) = { 1, 2, 2, 2, 1, 0, 0, 0 } and h(n) = { 1, 1, 1, 1, 0, 0, 0, 0 }
Now, the response y(n) is given by, y(n) = x(n) * h(n).
Let, DFT {x(n)} = X(k), DFT {h(n)} = H(k), DFT {y(n)} = Y(k).
By convolution theorem of DFT we get,
DFT {x(n) * h(n)} = X(k) H(k)
\ y(n) = DFT-1{Y(k)} = DFT-1{X(k) H(k)}
The various steps in computing y(n) are,
Step - 1 : Determine X(k) using radix-2 DIT algorithm.
Step - 2 : Determine H(k) using radix-2 DIT algorithm.
Step - 3 : Determine the product X(k)H(k).
Step - 4 : Take inverse DFT of the product X(k)H(k) using radix-2 DIT algorithm.
Step-1 : To determine X(k)
Since x(n) is an 8 point sequence, we have to compute 8-point DFT.
The 8-point DFT by radix-2 FFT algorithm consists of 3 stages of computations with 4 butterflies in each
stage.
The given sequence x(n) is arranged in bit reversed order as shown in the following table.
5. 47 Digital Signal Processing
x(n) x(n)
Normal order Bit reversed order
x(0) = 1 x(0) = 1
x(1) = 2 x(4) = 1
x(2) = 2 x(2) = 2
x(3) = 2 x(6) = 0
x(4) = 1 x(1) = 2
x(5) = 0 x(5) = 0
x(6) = 0 x(3) = 2
x(7) = 0 x(7) = 0
The sequence arranged in bit-reversed order forms the input sequence to the first stage computation.
First stage computation
Input sequence to first stage = { 1, 1, 2, 0, 2, 0, 2, 0 }.
The butterfly computation of first stage is shown in fig 1.
The phase factor involved in first
x (0) = −1 −1+ ( −1)= −2 stage of computation is W20 .
Since, W20 = 1, it is not
x (4) = −1 −1 −( −1) = 0
considered for computation.
x (2) = 2 2+0 = 2
x (6) = 0 2 −0 = 2
x (1) = 2 2+0 = 2
x (5) = 0 2 −0 = 2
x (3) = 2 2+0 = 2
x (7) = 0 2 −0 = 2
= cos
FG −π IJ + jsinFG −π IJ
H 2K H 2K
= −j
1 1
2 2+2=4
1
1 1
2 2 + 2( −j) = 2 − 2j
1
1 1
-1
2 2 −2 = 0
1
−j -1
2 2 − 2( −j) = 2 + 2j
1
0 0 + 4 = 4 = X(0)
1
− 2j −2 j + (2 − 2 j) × 0.707 − j0.707 = −j4 . 828 = X(1)
1 −4 + 0 × ( −j) = −4 = X(2)
−4
1
2j 2 j + (2 + 2 j) × −0.707 − j 0.707 = −j0 . 828 = X(3)
1
4 0 − 4 = −4 = X( 4)
0.707 −1
−j0.707
2−2j −2j − (2 − 2j) × 0 .707 − j0 .707 = j0 . 828 = X(5)
−1
−j
0 −4 − 0 × ( −j) = −4 = X(6)
−1
−0.707
−j0.707 2 j − (2 + 2 j) × −0 .707 − j0 .707 = j4 . 828 = X(7)
2+2j
−1
h(n) h(n)
Normal order Bit reversed order
h(0) = 1 h(0) = 1
h(1) = 1 h(4) = 0
h(2) = 1 h(2) = 1
h(3) = 1 h(6) = 0
h(4) = 0 h(1) = 1
h(5) = 0 h(5) = 0
h(6) = 0 h(3) = 1
h(7) = 0 h(7) = 0
The sequence arranged in bit reversed order forms the input sequence to the first stage.
h(0) = −1 −1+ 0 = −1
The phase factor involved in first
h(4) = 0 −1 −0 = −1 stage of computation is W20 .
h(2) = −1 −1+ 0 = −1 Since, W20 = 1, it is not
considered for computation.
h(6) = 0 −1 −0 = −1
h(1) = 1 1+0= 1
h(5) = 0 1 −0 = 1
h(3) = 1 1+0 = 1
h(7) = 0 1 −0 = 1
−j
1
-1 = cos
FG −π IJ + jsinFG −π IJ
−1 −1 − ( −1)( −j) = −1 − j
H 2K H 2K
1 1 = −j
1 1+1=2
1
1 1
1 1 + 1( −j) = 1 − j
1
1 1 -1
1 1 −1 = 0
1
−j -1
1 1 − 1( −j) = 1 + j
Phase factors involved in third stage computations are W80 , W81, W82 , and W83.
0
− j2π ×
W80 = e 8 =1
1 π
W81 = e
− j2π ×
8 =e
−j ×
4 FG −π IJ + j sinFG −π IJ = 1 − j 1 = 0 . 707 − j0 . 707
= cos
H 4K H 4K 2 2
2 π
W82 = e
− j2π ×
8 = e
−j ×
2 F −π IJ + j sinFG −π IJ = − j
= cosG
H 2K H 2K
3 3π
W83 = e
− j2π ×
8 = e
−j ×
4 F −3π IJ + j sinFG −3π IJ = − 1 − j 1 = −0 . 707 − j0 . 707
= cosG
H4K H4K 2 2
1
−2 −2 + 2 = 0 = H (0)
1
−1 + j −1 + j + 1 − j × 0 .707 − j0 .707 = −1 − j0 . 414 = H(1)
1
0 0 + 0 × ( −j) = 0 = H (2)
1
−1 − j −1 − j + 1 + j × −0 .707 − j0 .707 = −1 − j2 . 414 = H( 3 )
1
2 −2 − 2 = −4 = H (4)
0.707 −1
−j0.707
1 −j −1 + j − 1 − j × 0 .707 − j0 .707 = −1 + j2 . 414 = H(5)
−1
−j
0 0 − 0 × ( −j) = 0 = H (6)
−0.707 −1
−j0.707
1+j −1 − j − 1 + j × −0 .707 − j0 .707 = −1 + j0.414 = H (7)
−1
F ig 6 : B u tte rfly d ia gra m for th ird sta g e of rad ix-2 D IT F F T o f H (k ) .
5. 51 Digital Signal Processing
Output sequence of third UV = m0, − 1− j0.414, 0, r
− 1 − j2.414, − 4, − 1 + j2.414, 0, − 1 + j0.414
stage computation W
The output sequence of third stage computation is the 8-point DFT of h(n).
Y(k) Y(k)
Normal order Bit reversed order
Y(0) = 0 Y(0) = 0
Y(1) = −2 + j4.828 Y(4) = 16
Y(2) = 0 Y(2) = 0
Y(3) = −2 + j0.828 Y(6) = 0
Y(4) = 16 Y(1) = − 2 + j4.828
Y(5) = −2 − j0.828 Y(5) = −2 − j0.828
Y(6) = 0
Y(3) = − 2 + j0.828
Y(7) = 2 − j4.828
Y(7) = 2 − j4.828
First stage computation
Y(2) = 0 0+0=0
it is not considered for
computation.
Y(6) = 0 0 −0 = 0
Input sequence of second stage = m 16, − 16, 0, 0, − 4 + j4, j5.656, − 4 − j4, j5.656 r
The butterfly computation of second stage is shown in fig 8.
The phase factors involved are (W0 )∗ and (W1)∗. 4 4
0
∗ j2π ×
16
1 1
16 + 0 = 16 dW i
0
4 =e 4 = e0 = 1
1 1 π
j2π × j ×
1 ∗
−16
1 1
1
−16 + (0)(+j) = −16 dW i
4 =e 4 =e 2
1
1
-1 = cos
FG π IJ + jsinFG π IJ
0
1
16 − 0 = 16
H 2K H 2K
+j -1 =j
0 −16 − (0)(+j) = −16
1 1
−4 + j4 (−4 + j4) + (−4 − j4) = −8
1
1 1
j5.656 j5.656 + j5.656(j) = −5.656 + j5.656
1
1 1 -1
−4 − j4 (−4 + j4) − (−4 − j4) = j8
1
+j -1
j5.656 j5.656 − j5.656 (j) = 5.656 + j5.656
Input sequence of third |UV = m 16, − 16, 16, − 16, − 8, − 5.656 + j 5 .656 , j8, 5.656 + j 5.656 r
stage computation |W
The butterfly computation of third stage is shown in fig 9.
The phase factors involved are (W80 )∗ , (W81)∗ , (W82 )∗ and (W83 )∗ .
5. 53 Digital Signal Processing
0
j2π ×
(W80 )∗ = e 8 =1
1 π
(W81)∗ = e
j2π ×
8 =e
j ×
4 = cos
FG π IJ + j sinFG π IJ = 1 + j 1 = 0. 707 + j0. 707
H 4K H 4K 2 2
2 π
(W82 )∗ = e
j2π ×
8 =e
j ×
2 F πI F πI
= cosG J + j sinG J = j
H 2K H 2K
3 3π
(W83 )∗ = e
j2π ×
8 =e
j×
4 F 3π I F 3π I 1 + j 1 = −0. 707 + j0. 707
= cosG J + j sinG J = −
H 4K H 4K 2 2
1
16 16 + ( −8) = 8 = 8y (0)
1
−16 −16 + −5 . 656 + j5 . 656 0.707 + j0 .707 = −24 = 8y (1)
1
16 16 + j8(j) = 16 − 8 = 8y (2)
1
−16 −16 + 5. 656 + j5. 656 × −0.707 + j0.707 = −24 = 8 y (3)
1 16 − (−8) = 24 = 8y (4)
−8
−1
0.707
+ j0.7 07 −1
−5.656 + j5.656 −16 − −5 . 656 + j5 . 656 0.707 + j0.707 = −8 = 8 y(5)
+j −1
j8 16 − j8(j) = 16 + 8 = 24 = 8y(6)
−0.707
+ j0.7 07 −1
5.656 + j5.656 −16 − 5. 656 + j5. 656 × −0 .707 + j0.707 = −8 = 8y(7)