Computation of DFT
Computation of DFT
Computation of DFT
Computation of DFT
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
n =0 N 1 k =0
x(n)WNkn , X (k )WNkn ,
k = 0,1, K, N 1 n = 0,1, K, N 1
where
X ( 0) x (0) X (1) Let x (1) , , XN = xN = M M X ( N 1) x ( N 1)
and
1 1 1 W N 2 WN = 1 W N M M ( N 1) 1 W N 1 W W W
2 N 4 N
2 ( N 1) N
2 ( N 1) L WN L M ( N 1)( N 1) L WN L L 1
N 1 WN
Thus,
X N = WN x N xN = W XN 1 * = WN XN N
1 N
k Because the matrix (transformation) WN has a specific structure and because WN has par-
ticular values (for some k and n), we can reduce the number of arithmetic operations for computing this transform.
NCTU EE
DSP (2007)
Computation of DFT
Example
x[n ] = [0 1 2 3]
Only additions are needed to compute this specific transform. (This is a well-known radix-4 FFT) Thus, the DFT of x[n ] is
6 2 + 2 j X 4 = W4 x 4 = 2 2 2 j
k+N k Periodicity: WN = WN
Particular values of k and n: e.g., radix-4 FFT (no multiplications) Direct computation of DFT
X [k ] = =
N 1 n =0 N 1 n =0
x[n] WNkn ,
k = 0,1, K , N 1
For each k, we need N complex multiplications and N-1 complex additions. 4N real multiplications and 4N-2 real additions. We will show how to use the properties of WN to reduce computations. Radix-2 algorithms: Decimation-in-time; Decimation-in-frequency Composite N algorithms: Cooley-Tukey; Prime factor Winograd algorithm Chirp transform algorithm
k
NCTU EE
DSP (2007)
Computation of DFT
-point DFT N
-point DFT
N -point DFT 4
x[n ] L x[ N 1] 2
L x[ N 1]
L x[ N 2 ]
14243
n =2 r
n odd
14243
n =2 r +1 N 1 2 r =0
QW = e
N 1 2
=e
2 j N /2
= WN / 2
rk k rk X [k ]= x[2r ]WN / 2 + WN x[ 2 r + 1]WN / 2 r= =04 0 4 1r 4 244 3 14 4 2444 3 N -point DFT 2 N -point DFT 2
N 1 2
k = G[ k ] + W N H [k ]
NCTU EE
DSP (2007)
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 ~ N complex multiplications and N complex adds
2 2
2 2
+ additional
complex adds
~ (Total:) N + 2 N = N + N complex multis and adds 2 2 (c) log 2 N -stage FFT Since N = 2 , we can further break N -point DFT into two N -point DFT and
so on.
At each stage: ~
NCTU EE
DSP (2007)
Computation of DFT
One multiplication:
NCTU EE
DSP (2007)
Computation of DFT
In-place computations Only two registers are needed for computing a butterfly unit.
r X m [ p ] = X m 1 [ p ] + W N X m 1 [ q] r X m [ q] = X m 1 [ p ] W N X m 1 [ q ]
Advantage: less storage! In order to retain the in-place computation property, the input data are accessed in the bit-reversed order. Note: The outputs are in the normal order (same as the position) Binary equivalent Bit reversed 6 110 011 2 010 010 Remark: Index 3 input data is placed at position 6. Position Sequence index 3 2
We may also place the inputs in the normal order; then the outputs are in the bit-reversed order.
NCTU EE
DSP (2007)
Computation of DFT
If we try to maintain the normal order of both inputs and outputs, then in-place computation structure is destroyed.
NCTU EE
DSP (2007)
Computation of DFT
x( n )W Nkn ,
k = 0,1,K , N 1
If k is even,
X [2 r ] = =
N 1 n =0 N 1 2 n =0
k = 2r .
r = 0,1, L ,
N 1
x[n ]WNkn ,
N 1 2 n (n + N ) 2
N
2 r n+ N = x[n ]W + x n + WN 2 2 n =0 n =0 2 r[ n+ N ] 2 rn 2 rn rN 2 Q WN = WN WN = WN 2 nr N
N 1 2
= =
N 1 2
n =0 N 1 2 n =0
n+ x[n ] + x n+ x[n ] + x
N 2 nr WN 2 N nr WN 2 2
Similarly, if k is odd,
X [2 r + 1] =
N 1 2 n =0
k = 2r + 1 .
N n nr WN WN 2 2
N nr WN 2 2 N n nr WN WN 2 2
x[n] x n +
N 1 2 n =0 N 1 2 n =0
X [2r ] = X [2r + 1] =
n+ x[n] + x n+ x[n] x
NCTU EE
DSP (2007)
Computation of DFT
We can further break X [2r ] into even and odd groups Again, we can reduce the two-multiplication butterfly into one multiplication. Hence, the computational complexity is bout N log N . The in-place computation property holds if the 2
2
outputs are in bit-reversed order (when inputs are in the normal order).
NCTU EE
DSP (2007)
Computation of DFT
Remark: n ( n1 , n2 ) and k ( k1 , k 2 )
Goal: Decompose N-point DFT into two stages:
x[n]WNkn ,
0 k N 1
= X [k1 + N 1k 2 ] = =
N 2 1 N1 1 n2 =0 n1 =0 N 2 1 N1 1 n2 =0 n1 =0
x[ N 2 n1 + n2 ] WN(k + N k )( N n +n )
1 1 2 2 1 2
N kn W k n x[ N 2 n1 + n2 ] W N 1 23 N
2 1 1 k1n1 WN 1
1 2
k1n1 k1n2 k2n2 W = x[ N 2 n1 + n2 ] WN N3 WN 2 1 1 2 n2 =0 n1 =0 twiddle 1444 4 24444 3 factor N point 44444 44 1 14 44 2444444 3
N 2 1 N1 1 N 2 -point
x[ N 2 n1 + n2 ] WNk n
1 1 1
(3) Compute
X [k1 + N1k 2 ] =
G[n2 , k1 ] WNk n
2 2 2
NCTU EE
10
DSP (2007)
Computation of DFT
NCTU EE
11
DSP (2007)
Computation of DFT
Extension:
N = N 1 N 2 L N
+ 1
In general,
(N ) = N
i =1
(Ni )
Ni
+ ( 1)
would make half of the branches becoming 1. Special Case: N 1 = N 2 = L = N = 2 Radix-2: N 1 = N 2 = L = N = 2 and = log 2 N
NCTU EE
12
DSP (2007)
Computation of DFT
Inverse FFT
IDFT: DFT:
x[n ] = 1 N
N 1 k =0
X [k ] WNkn
N 1 n =0
(*)
X [k ] =
x[n] W Nnk
*
= = =
1 N 1 N 1 N 1 N
N 1 kn X [k ] W N k =0
N 1 k =0 N 1 k =0
(X [k ] W Nkn )
(X * [k ] W Nkn )
DFT X * ( k )
( (
[ [
]) ])
Thus, we can use the FFT algorithm to compute the inverse DFT.
NCTU EE
13