0% found this document useful (0 votes)
35 views23 pages

FPGA Lec07 FFT

Uploaded by

Farhan Mashuk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views23 pages

FPGA Lec07 FFT

Uploaded by

Farhan Mashuk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Advanced Topics in Communications Electronics

FPGA Information Processing Systems

Lecture 7 Fast Fourier Transform and


Discrete Cosine Transform
Chapter 6 of the book by Uwe Meyer-Baese

Lecture 7 1
Fourier Transform

Fourier transform Inverse Fourier transform

Complex number

Lecture 7 2
Discrete Fourier Transform (DFT)

Discrete Fourier transform (DFT)

𝑘 = 0,1, … , 𝑁 − 1

Inverse Discrete Fourier transform (IDFT)

𝑛 = 0,1, … , 𝑁 − 1

Lecture 7 3
Properties
Discrete Fourier transform (DFT)

Symmetry:

Periodicity:

Lecture 7 4
Fast Fourier Transform (FFT)

Lecture 7 5
Example of Cooley-Tukey FFT

0 x[0] x[1] x[2]


0 X[0] X[1] X[2] X[3]
1 x[3] x[4] x[5]
1 X[4] X[5] X[6] X[7]
2 x[6] x[7] x[8]
2 X[8] X[9] X[10] X[11]
3 x[9] x[10] x[11]

𝑛 = 𝑁! 𝑛" + 𝑛! 𝑘 = 𝑘" + 𝑁" 𝑘!

Lecture 7 6
Cooley-Tukey FFT

Twiddle N1-point DFT


factor

N2-point DFT
Lecture 7 7
12-Point FFT 𝑥[𝑛
̅ !, 𝑘"]

6.2 The Fast Fourier Transform (FFT) Algorithms

𝑛 = 𝑁! 𝑛" + 𝑛! , 𝑘 = 𝑘" + 𝑁" 𝑘! 4−point DFTs 3−point DFTs


n1 = Twiddle factors k 2=
0 0
x[0] w0 X[0]
1 1
0 x[0] x[1] x[2] x[3] n 2=0
w0 k1 =0 X[4]
2 2
x[6] w0 X[8]
1 x[3] x[4] x[5] 3 0
x[9] w0 X[1]
2 x[6] x[7] x[8] x[1] 0
w1 k1 =1
1
X[5]
1 2
3 x[9] x[10] x[11] x[4] n 2=1
w2 X[9]
2 0
x[7] w0 X[2]
3 1
x[10] w2 k1 =2 X[6]
0 2
0 X[0] X[1] X[2] X[3] x[2] w4 X[10]
1 0
1 X[4] X[5] X[6] X[7]
x[5] n 2=2
w0 X[3]
2 1
x[8] w3 k1 =3 X[7]
2 X[8] X[9] X[10] X[11] x[11] 3
w6
2
X[11]
Lecture 7 8
Computation Cost Comparison
12-point DFT
• 122 multiplications
• 11x12=132 additions
Complex numbers

12-point FFT
# $
• 12 multiplications of 𝑊"!! " , 8 of which are trivial
• 4*(3-point DFT, 9*, 6+) = 36*, 24+
• 3*(4-point DFT, 16*, 12+) = 48*, 36+
• Total 88 multiplications, 60 additions
Lecture 7 9
Efficient Complex Multiplier

Lecture 7 10
Radix-r Cooley-Tukey Algorithm

Lecture 7 11
Divide-and-Conquer by 2

𝑋 𝑘 = 𝐺 𝑘 + 𝑊%$ 𝐻[𝑘]
Lecture 7 12
!
Reusing point DFT
" & &
! '" ! '"
𝑁 #) #)
For 𝑘 = 0,1, … , −1 𝑋 𝑘 = * 𝑓" [𝑚]𝑊&/! + 𝑊&) * 𝑓! [𝑚]𝑊&/!
2
#$% #$%
𝑋 𝑘 = 𝐺 𝑘 + 𝑊%$ 𝐻[𝑘]
𝑁 𝑁
For 𝑘 = , + 1, … , 𝑁 − 1
2 2
& &
! '" & & & & !
'"
& &
#()' ! + ! ) )' ! + ! #()' ! + ! )
𝑋𝑘 = * 𝑓" [𝑚]𝑊&/! + 𝑊& * 𝑓! [𝑚]𝑊&/!
#$% #$%
& &
! '" & & !
'"
&
#()' ! ) )' ! #()' ! )
= * 𝑓" [𝑚]𝑊&/! − 𝑊& * 𝑓! [𝑚]𝑊&/!
#$% #$%
%
𝑁 $& ! 𝑁
𝑋 𝑘 =𝐺 𝑘− − 𝑊% 𝐻[𝑘 − ]
2 2
Lecture 7 13
nal Processing: A User's Guide
those of the odd-indexed samples as
glas L. Jones
. Because of the periodicity with frequency samples of
th- DFTs, and can be used to compute two of the length- DFT frequencies, namely
nts Search this book
, but with a different twiddle factor. This reuse of these short-length DFT outputs gives the

Divide-and-Conquer for 8-point DFT


mputational savings.
/contents/[email protected]:DAsQCjnU/Power-

of-two-FFTs)
Next

-
𝑋 𝑘 = * 𝑓" [𝑚]𝑊.#)
#$%
-
+𝑊/) * 𝑓! [𝑚]𝑊.#)
#$%

𝑋 𝑘 = 𝐺 𝑘 + 𝑊&) 𝐻[𝑘]
𝑘 = 0,1,2,3

𝑋 𝑘 = 𝐺 𝑘 − 4 + 𝑊&) 𝐻 𝑘 − 4
𝑋 𝑘 = 𝐺 𝑘 − 4 − 𝑊&)'. 𝐻 𝑘 − 4
𝑘 = 4,5,6,7

𝑋 0 = 𝑥 0 𝑊 " + 𝑥 2DFT
gure 1. Decimation in time of !
"
𝑊!into 4 𝑊!"DFTs
+two𝑥length-
a length- + 𝑥followed
6 𝑊!by "
+ 𝑊#"(𝑥 stage.
a combining 1 𝑊!" + 𝑥 3 𝑊!" + 𝑥 5 𝑊!" + 𝑥 7 𝑊!")
𝑋 5 = 𝑥 0 𝑊!" + 𝑥 2 𝑊!$ + 𝑥 4 𝑊!%" + 𝑥 6 𝑊!%$ + 𝑊#$(𝑥 1 𝑊!" + 𝑥 3 𝑊!$ + 𝑥 5 𝑊!%" + 𝑥 7 𝑊!%$)
irect computation of all DFT frequencies according to the DFT equation (/contents/a806bd3a-194f-
𝑋 5 = 𝑥 0 𝑊!" + 𝑥 2 𝑊!$ + 𝑥 4 𝑊!%" + 𝑥 6would
[email protected]:01e3cf62-3ba9-4fc9-bbde-d62220112b12@5) 𝑊!%$require
− 𝑊#%(𝑥 1 𝑊!" +
complex 𝑥 3 𝑊!$ + 𝑥 5 𝑊!%" + 𝑥 7 𝑊!%$)
and complex additions (for complex-valued data), by reusing the results of the two short-
s as illustrated in Figure, the computational cost is now
Lecture 7 14
worthwhile to note that, after merging the twiddle factors to a single term on the lower branch, the remaining
Book by: Douglas L. Jones
butterfly is actually a length-2 DFT! The theory of multi-dimensional index maps (/contents/a806bd3a-194f-
[email protected]:170fb301-92e3-4500-86d8-ccab60900f5c@3)
Contents Search this book shows that this must be the
case, and that FFTs of any factorable length may consist of successive stages of shorter-length FFTs with

Simplification
Back (/contents/[email protected]:DAsQCjnU/Power-
twiddle-factor multiplications in between.

of-two-FFTs)
Next

(a) (b)

Figure 2. Radix-2 DIT butterfly simplification: both operations produce the same outputs

Radix-2 decimation-in-time FFT 𝑁


𝑋 𝑘 = 𝐺 𝑘 + 𝑊%$ 𝐻[𝑘] 𝑋 𝑘+ = 𝐺 𝑘 − 𝑊%$ 𝐻[𝑘]
2 length DFT (/contents/a806bd3a-
The same radix-2 decimation in time can be applied recursively to the two
[email protected]:01e3cf62-3ba9-4fc9-bbde-d62220112b12@5)s to save computation.
When successively applied until the shorter and shorter DFTs reach length-2, the result is the radix-2 DIT FFT
algorithm.
Lecture 7 15
Recursion for Radix-2
𝑁
𝑋 𝑘 =𝐺 𝑘 + 𝑊%$ 𝐻[𝑘] 𝑋 𝑘+ = 𝐺 𝑘 − 𝑊%$ 𝐻[𝑘]
2
Repeat the divide-and-conquer for 𝐺[𝑘] and 𝐻 𝑘 , recursively

2-point
DFT Combine
2-point
2-point DFTs Combine
DFT 4-point
DFTs
2-point
DFT Combine
2-point
2-point DFTs
DFT

Lecture 7 16
8-point Radix-2 FFT
2-point 𝑎 𝐴 = 𝑎 + 𝑊%' 𝑏
butterfly 𝑊%'
𝑏 −1 𝐵 = 𝑎 − 𝑊%' 𝑏
) G0
𝐺 𝑘 = 𝑃 𝑘 + 𝑊&/! 𝑄𝑘 P0
&
. '"
P1 G1
0)
𝑃 𝑘 =* 𝑔" [𝑖]𝑊&/. Q0
0$% G2
& Q1
. '" 0)
G3
𝑄 𝑘 =* 𝑔! [𝑖]𝑊&/.
0$%
𝑃 0 = 𝑥 0 𝑊!% + 𝑥 4 𝑊!%
𝑃 1 = 𝑥 0 𝑊!% + 𝑥 4 𝑊!"
𝑄 0 = 𝑥 2 𝑊!% + 𝑥 6 𝑊!%
𝑄 1 = 𝑥 2 𝑊!% + 𝑥 6 𝑊!"
𝐺 0 = 𝑃 0 + 𝑊.% 𝑄 0
𝐺 1 = 𝑃 1 + 𝑊." 𝑄 1
Decimation in time
Lecture 7 17
8-point Radix-2 FFT
366 6. Fourier Transforms
Decimation in frequency
1. Stage 2. Stage 3. Stage
000 x[0] X[0] 000
001 x[1] −1
X[4] 100
W0
010 x[2] −1
X[2] 010
W2
011 x[3] −1 −1
X[6] 110
W0
100 x[4] −1
X[1] 001
W1
101 x[5] −1 −1
X[5] 101
W2 W0
110 x[6] −1 −1
X[3] 011
W3 W2
111 x[7] −1 −1 −1
X[7] 111
Group Butterfly
Lecture 7 18
Fig. 6.13. Decimation-in-frequency algorithm of length-8 for radix-2.
Discrete Cosine Transform (DCT)

Real number

Popular

Lecture 7 19
DCT by IDFT
Temporarily ignore
constant coefficients

Let 𝑛1 = 𝑁 − 𝑛 − 1 𝐵
&'"
1
𝑘𝜋 1
3
𝐵 = * 𝑦 𝑛 cos (2𝑁 − 2𝑛 − 2 + )
&
𝑁 2
2 $&/!
&'" &'"
1
𝑘𝜋 1
1 1
𝑘𝜋 1
1
𝐵 = * 𝑦 𝑛 cos (−2𝑛 − ) = * 𝑦 𝑛 cos (2𝑛 + )
&
𝑁 2 &
𝑁 2
2 $&/! 2 $&/!
Lecture 7 20
DCT by Shorter IDFT 𝑌[𝑘]
&'" &'"
1 𝜋 4)
3!&
!4)2
3 &
𝑋 𝑘 = * 𝑦 𝑛 cos 𝑘 2𝑛 + = ℜ(𝑒 * 𝑦[𝑛]𝑒 )
2 𝑁
2$% )$ 2$%
(!%
𝐻𝑘 = 𝑒 𝑌[𝑘]
)(%&$) ) )$ conjugate
( !% ( ! &(!%
𝐻 𝑁−𝑘 = 𝑒 𝑌 𝑁−𝑘 = 𝑒 𝑒 𝑌 −𝑘 = 𝑗𝐻 ∗ [𝑘]
If 𝑧 = 𝑎 + 𝑗𝑏, 𝑗𝑧 ∗ = 𝑏 + 𝑗𝑎 𝑋 𝑁−𝑘 =ℜ 𝐻 𝑁−𝑘
= ℜ 𝑗𝐻 ∗ [𝑘]
𝑋 𝑘 = ℜ(𝐻 𝑘 ) 𝑁
= 𝑘 = 0,1, … , = ℑ(𝐻 𝑘 )
𝑋 𝑁 − 𝑘 = ℑ(𝐻 𝑘 ) 2
%
An N-point DCT is computed by +1 -point IDFT
!

Lecture 7 21
Fast 8-point DCT
C. Loeffler, et al., 1989

11 multiplications
29 additions

Lecture 7 22

You might also like