Академический Документы
Профессиональный Документы
Культура Документы
2014-04-01
Introduction to HPC
Lecture 20
Lennart Johnsson
Dept of Computer Science
1
COSC6365 Lennart Johnsson
2014-04-01
Signal
Image Processing
Processing Medical In Radio
In Electron Imaging Astronomy Modeling and
Microscopy Solution of PDEs
FFT O(PlogP)
Cooley-Tukey, radix-2, -4, -8, .
Mixed-radix Cooley-Tukey (MR)
Prime Factor Algorithm (PFA)
Split-radix (SR)
Raders Algorithm
Transforms on real data
Sine, Cosine transforms: transforms on
real data with symmetry (odd and even
symmetry, respectively)
(Cosine transforms are used for JPEG, MPEG, )
2
COSC6365 Lennart Johnsson
2014-04-01
P
j=0
P
j=0
The DFT
X(0) 1 1 1 1 .. 1 x(0)
X(1) 1 P1 P2 P3 . P(P-1) x(1)
X(2) x(2)
1 1 P P P . P
2 4 6 2(P-1)
=
X(3) P 1 P3 P 6 P 9 . P 3(P-1) x(3)
.
.
.
X = Wx
The DFT is indeed Matrix-vector multiplication
3
COSC6365 Lennart Johnsson
2014-04-01
.
.
.
x(P-1) 1 P-(P-1) P-(P-1)2 P-(P-1)3 . P-(P-1)(P-1) X(P-1)
FFT
Decimation-in-time (DIT)
Decimation-in-frequency (DIF)
Ordered vs scrambled (bit-reversed)
Self-sorting
In-place
4
COSC6365 Lennart Johnsson
2014-04-01
DIF FFT
P
-1 1
DIF FFT
First computation step
The butterfly
5
COSC6365 Lennart Johnsson
2014-04-01
DIF FFT
First computation step
DIF FFT
Result after recursive application of DIF splitting formula
6
COSC6365 Lennart Johnsson
2014-04-01
DIF FFT
7
COSC6365 Lennart Johnsson
2014-04-01
DIT FFT
since
8
COSC6365 Lennart Johnsson
2014-04-01
DIT FFT
The last computation step
The DIT butterfly
DIT FFT
Result after recursive application of DIT splitting formula
9
COSC6365 Lennart Johnsson
2014-04-01
DIT FFT
Bit-reversed order (scrambled)
10
COSC6365 Lennart Johnsson
2014-04-01
DIF FFT
Normal to Bit-reversed order Bit-reversed to Normal order
11
COSC6365 Lennart Johnsson
2014-04-01
DIT FFT
Bit-reversed to Normal order Normal to Bit-reversed order
12
COSC6365 Lennart Johnsson
2014-04-01
13
COSC6365 Lennart Johnsson
2014-04-01
For rewrite as
14
COSC6365 Lennart Johnsson
2014-04-01
15
COSC6365 Lennart Johnsson
2014-04-01
With rewrite as
16
COSC6365 Lennart Johnsson
2014-04-01
17
COSC6365 Lennart Johnsson
2014-04-01
FFT
Arithmetic Operations Storage References
FFT Add/Sub Mult Total Data Twiddles Total
Radix-2 3Pp 2Pp 5Pp 4Pp Pp 5Pp
Radix-4 (22/8)Pp (12/8)Pp (17/4)Pp (16/8)Pp (6/8)Pp (11/4)Pp
Radix-8 (66/24)Pp (32/24)Pp (49/12)Pp (32/24)Pp (14/24)Pp (23/12)Pp
Communication
Input order Consecutive Cyclic
Normal First n stages Last n stages
Bit-reversed Last n stages First n stages
18
COSC6365 Lennart Johnsson
2014-04-01
Processor 0
Processor 1
Processor 2
Processor 3
Communication Local
Processor 0
Processor 1
Processor 2
Processor 3
Processor twiddle factor subset the same in forward and inverse FFT
19
COSC6365 Lennart Johnsson
2014-04-01
20
COSC6365 Lennart Johnsson
2014-04-01
21
COSC6365 Lennart Johnsson
2014-04-01
22
COSC6365 Lennart Johnsson
2014-04-01
Step 1: exchange (0 2 1 | 3)
Step 2: exchange (0 3 1 | 2)
Step 3: exchange (0 3 2 | 1)
Step 4: exchange (1 3 2 | 0)
23
COSC6365 Lennart Johnsson
2014-04-01
24
COSC6365 Lennart Johnsson
2014-04-01
(p-addr|m-addr)
(1 0 2 |4 3) (1 0 2 |4 3) (1 0 2 |4 3) (..|.)
(1 0 3 |4 2) (1 0 4 |2 3) (4 0 3 |1 2) (..|.)
(4 2 3 |1 0) (2 3 4 |1 0) (4 2 3 |1 0) (. |.)
25
COSC6365 Lennart Johnsson
2014-04-01
26
COSC6365 Lennart Johnsson
2014-04-01
27
COSC6365 Lennart Johnsson
2014-04-01
Proc ID P0 P1 P2 P3 P4 P5 P6 P7 Proc ID P0 P1 P2 P3 P4 P5 P6 P7
0 4 8 12 16 20 24 28
0 2 4 6 8 10 12 14
Twiddle 16 18 20 22 24 26 28 30 Twiddle 0 4 8 12 16 20 24 28
expon. expon.
2nd 3rd stage 0 4 8 12 16 20 24 28
stage 0 2 4 6 8 10 12 14
16 18 20 22 24 26 28 30 0 4 8 12 16 20 24 28
28
COSC6365 Lennart Johnsson
2014-04-01
29
COSC6365 Lennart Johnsson
2014-04-01
Twiddle
expon. 1st 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
stage 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Twiddle 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
expon. 2nd
stage 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
Twiddle
expon. 3rd 0 16 8 24 0 16 8 24 0 16 8 24 0 16 8 24
stage 0 16 8 24 0 16 8 24 0 16 8 24 0 16 8 24
Twiddle 0 8 4 12 0 8 4 12 0 8 4 12 0 8 4 12
expon. 4th
stage 16 24 20 28 16 24 20 28 16 24 20 28 16 24 20 28
Twiddle
expon. 5th 0 4 2 6 16 20 18 22 8 12 10 14 24 28 26 30
stage 0 4 2 6 16 20 18 22 8 12 10 14 24 28 26 30
Twiddle 0 2 1 3 8 10 9 11 4 6 5 7 12 14 13 15
expon. 6th
stage 16 18 17 19 24 26 25 27 20 22 21 23 28 30 29 31
30
COSC6365 Lennart Johnsson
2014-04-01
FFT4 FFT4
FFT4 FFT4
FFT4 FFT4
FFT4 FFT4
Square Transpose
(c)
31
COSC6365 Lennart Johnsson
2014-04-01
Square Transpose
32
COSC6365 Lennart Johnsson
2014-04-01
33
COSC6365 Lennart Johnsson
2014-04-01
34