DSP Module 3 Notes
DSP Module 3 Notes
Computation of DFT
Efficient algorithms for computing DFT – Fast Fourier Transform.
(a) Compute only a few points out of all N points
(b) Compute all N points
What are the efficiency criteria?
Number of multiplications
Number of additions
Chip area in VLSI implementation
x ( 0) X ( 0)
Let
x (1) X (1)
xN , X N ,
x ( N 1) X ( N 1)
and
1 1 1 1
1 W W N2 WN N 1
N
WN 1 W N2 W N4 W N2( N 1)
( N 1) 2 ( N 1)
1 W N WN W N( N 1)( N 1)
Thus,
X N WN x N N - point DFT
x N WN1X N N - point IDFT
1
WN* X N
N
Because the matrix (transformation) WN has a specific structure and because WNk has par-
ticular values (for some k and n), we can reduce the number of arithmetic operations for
computing this transform.
NCTU EE 1
DSP (2015 Spring) Computation of DFT
Example x[n ] [0 1 2 3]
W40 W40 W40 W40 1 1 1 1
0 3
W4 W4 W4 W4 1 W4 W4 W4
1 2 1 2 3
W4
W40 W42 W44 W46 1 W42 W40 W42
0 3 6 9 3 2 1
W4 W4 W4 W4 1 W4 W4 W4
1 1 1 1
1 j 1 j
1 1 1 1
1 j 1 j
Only additions are needed to compute this specific transform.
(This is a well-known radix-4 FFT)
6
Thus, the DFT of x[n ] is X W x 2 2 j
2
4 4 4
2 2 j
NCTU EE 2
DSP (2015 Spring) Computation of DFT
k
We will show how to use the properties of WN to reduce computations.
2
2 j 2 j
WN2 e N
e N /2
WN / 2
N N
1 1
2 2
X [k ] x[2r ]WNrk/ 2 WNk x[2r 1]WNrk/ 2
0
r r 0
N N
-point DFT -point DFT
2 2
G[k ] WNk H [k ]
NCTU EE 3
DSP (2015 Spring) Computation of DFT
Comparison:
(a) Direct computation of N-point DFT (N frequency samples):
~ N 2 complex multiplications and N 2 complex adds
(b) Direct computation of N -point DFT:
2
2 2
~ N complex multiplications and N complex adds
2 2
+ additional N complex multis and N complex adds
2
~ (Total:) N 2 N N N complex multis and adds
2
2 2
(c) log 2 N -stage FFT
Since N 2 , we can further break N -point DFT into two N -point DFT and
2 4
so on.
NCTU EE 4
DSP (2015 Spring) Computation of DFT
NCTU EE 5
DSP (2015 Spring) Computation of DFT
One multiplication:
In-place computations
Only two registers are needed for computing a butterfly unit.
X m [ p ] X m 1 [ p ] W Nr X m 1 [ q]
X m [ q] X m 1 [ p ] W Nr X m 1 [ q ]
NCTU EE 6
DSP (2015 Spring) Computation of DFT
We may also place the inputs in the normal order; then the outputs are in the bit-reversed
order.
If we try to maintain the normal order of both inputs and outputs, then in-place compu-
tation structure is destroyed.
NCTU EE 7
DSP (2015 Spring) Computation of DFT
If k is even, k 2r .
N 1
N
X [2 r ] x[n ]WNkn , r 0,1, ,
2
1
n 0
N
1
2 N 1
x[n ]WN2 nr N x[n ]WN2 nr n (n N )
2
n 0 n
2
N N
1 1 N
2r n
2
2N
x n WN 2
x[n ]WN2 nr
n 0 n 0 2
2 r[ n N ]
WN 2 WN WN WN2 rn
2 rn rN
N
1
2 N
x[n] x n WN
2 nr
n 0 2
N
1
2 N
x[n ] x n WN 2
nr
n 0 2
Similarly, if k is odd, k 2r 1 .
N
1
2
N
X [2r 1] x[n ] x n WN WN 2
n nr
n 0 2
NCTU EE 8
DSP (2015 Spring) Computation of DFT
N
1
X [2 r ] 2 N nr
x[n] x n WN 2
2
n 0
N
1
2 N n
X [2r 1] x[n] x n
2
WN WN 2
nr
n 0
N
g[n ] x[n ] x n
Let 2
h[n ] x[n ] x n
N
2
NCTU EE 9
DSP (2015 Spring) Computation of DFT
0 n1 N 1 1
Time index : n N 2 n1 n2
0 n2 N 2 1
Freq. index : k k1 N1k 2 0 k1 N1 1
0 k 2 N 2 1
Remark: n ( n1 , n2 ) and k ( k1 , k 2 )
Goal: Decompose N-point DFT into two stages:
n2 0 n1 0
N 2 1 N1 1
x[ N 2 n1 n2 ] W N kn
N N
W k n 2 1 1 1 2
WNk1N1n2 WNN1N 2k2n1
n2 0 n1 0
WNk1n1 WNk2 n2 1
1 2
N 2 1 N1 1
k1n1 k1n2
x[ N 2 n1 n2 ] WN1 WN WNk22n2
n2 0 n1 0
twiddle
N1 -point factor
N 2 -point
Procedure
N1 1
G[n2 , k1 ] x[ N 2 n1 n2 ] WNk n 1 1
1
n1 0
N 2 1
~
X [k1 N1k 2 ] G[n2 , k1 ] WNk n 2 2
2
n2 0
NCTU EE 10
DSP (2015 Spring) Computation of DFT
NCTU EE 11
DSP (2015 Spring) Computation of DFT
Extension: N N 1 N 2 N
Let ( N ) number of multiplications for N - point DFT
If N N 1 N 2
( N ) N 2 ( N1 ) N1 ( N 2 ) N
( N1 ) ( N 2 )
N 1
N1 N2
In general,
(Ni )
( N ) N ( 1)
i 1 Ni
Special Case: N 1 N 2 N 2
0 1
W46 W49 1 W4 W4 W4 1 j 1 j
3 3 2
W4 W4
NCTU EE 12
DSP (2015 Spring) Computation of DFT
Inverse FFT
IDFT: 1 N 1
(*)
x[n ]
N
X [k ] WNkn
k 0
N 1
DFT:
X [k ] x[n] W Nnk
n 0
X * [k ] WNkn
N 1
1
N k 0
1
N
DFT X * ( k )
Take the conjugate of the above equation:
x[ n ]
1
N
DFT X * ( k )
*
1
N
FFT X * ( k ) *
Thus, we can use the FFT algorithm to compute the inverse DFT.
and yk [ n ] x[r ]W
r
k ( N r )
N u[ n r ] x[n] (WN knu[n]) ,
X [ k ] yk [ n ] n N
NCTU EE 13
DSP (2015 Spring) Computation of DFT
1
H k ( z)
1 WN k z 1
If x[n] is complex, we need 4 real multiplications and 4 real additions to compute each
yk[n].
To compute yk[N], we need to compute yk[1], yk[2], …, yk[N-1].
We need 4N real multiplications and 4N real additions to compute X[k].
Remarks:
less efficient than the direct method.
1 WNk z 1 1 WNk z 1
H k ( z)
(1 WN k z 1 )(1 WNk z 1 ) 1 2 cos( 2k / N ) z 1 z 2
If x[n] is complex, we only need 2 real multiplications and 4 real additions to implement
the poles of the system.
(The complex multiplication by W Nk needs not be performed at every iteration.)
To compute X[k], we need 2N real multiplications and 4N real additions for the poles
and 4 real multiplications and 4 real additions for the zero.
Remarks:
NCTU EE 14