03278999 - Computer Science

Parallel Fast Fourier Transform
Ryan Liu
Introduction
The Discrete Fourier Transform could be
applied in science and engineering.
 Examples:
◦ Voice recognition
◦ Image processing
 Discrete Fourier Transform (DFT): O(n2)
 Fast Fourier Transform (FFT): O(n log n)

2
Fourier Analysis


Fourier analysis: Represent continuous functions by
potentially infinite series of sine and cosine functions.
Fourier Series: A function can be expressed as the sum
of a series of sines and cosines:
3
Fourier Transform


Fourier Series can be generalized to derive the Fourier
Transform
Forward Fourier Transform:

F (k )   f ( x)e
 2ikx


dk
Inverse Fourier Transform:

f ( x)   F (k )e2ikx dk

Note:
e xi  cos( x)  i sin( x)
4
Fourier Transform

Fourier Transform maps a time series into the
series of frequencies that composed the time
series.

Inverse Fourier Transform maps the series of
frequencies back into the corresponding time
series.

The two functions are inverses of each other.
5
Discrete Fourier Transform


Maps a sequence over time to another sequence over frequency.
The Discrete Fourier Transform (DFT):
N 1
X k   f ne
2i
kn
N
k = 0, … N -1
n 0
2i
kn
1 N 1
fn   X k e N
N k 0
n = 0, … N -1
Let k represent the discrete time signal, and Fn represent discrete
frequency transform function.
6
Speech example of DFT
“Angora cats are furrier…”
Signal
Frequency
and amplitude
7
DFT Computation


n elements vector x.
DFT matrix vector product Fnx
◦ fi,j = wnij for
, j < n, and wn is the primitive nth root of unity.
0i
N 1
X k   fnw
n 0
wn  e
2i
N
 kn
N
1
fn 
N
N 1
X
k 0
k
w
kn
N
 cos( 2 / N )  i sin( 2 / N )
8
DFT Example1

DFT of vector (2,3)
◦ The primitive square root of unity for w2 is -1
 w200
 10
w
 2
w201  x0  1 1  2   5 
   
    
11 
w2  x1  1  1 3    1
◦ The inverse of DFT
 w200
 10
w
 2
w201  x0  1 1 1  5   2 
   
    
11 
w2  x1  2 1  1  1  3 
9
DFT Example2


DFT of vector (1,2,4,3)
The primitive 4th root of unity for w4 is i
 w40
 0
 w4
 w0
 4
 w0
 4
w40
w40
w14
w42
w42
w44
w43
w46
w40  x0  1 1 1 1  1   10 
  
  

3
w4  x1  1 i  1  i  2    3  i 


6 




1 1 1 1 4
0 
w4  x2
  
  






9 

w4  x3  1  i  1 i  3    3  i 
10
DFT Example2

Inverse DFT
 w40
 0
1  w4
4  w40
 w0
 4
w40
w40
w41
w4 2
w4 2
w4 4
w43
w46
w40  x0 
1 1 1 1  10 

 



3
w4  x1  1 1  i  1 i   3  i 
 
 6 

4 1  1 1  1 0 
w4  x2
 







9 

1
i

1

i

3

i
w4  x3 



 4  1
   
1  8   2
   
4
4 16
   
12   3 
   
11
Fast Fourier Transform

DFT requires O(n2) time to process for n samples:

So, using DFT is not a best way in practice.

Fast Fourier Transform:
◦ Produces exactly the same result as the DFT.
◦ Time complexity O(n log(n)).
◦ divide-and-conquer strategy.
12
FFT


Recursively breaks down a DFT of any composite size N = N1N2
into many smaller DFTs of sizes N1 and N2, along with O(N)
multiplication.
It’s to divide the transform into two pieces of size N/2 at each step.
13
Parallel FFT

Algorithm: recursive
FFT(1,2,4,3)
FFT(1,4)
FFT(1)
FFT(2,3)
FFT(4)
FFT(2)
FFT(3)
14
Parallel FFT

Tracking the flow of data values.
15
Phases of Parallel FFT

Phase 1: Processes permute the input sequence.

Phase 2:
◦ First log n – log p iterations of FFT
◦ No message passing is required

Phase 3:
◦ Final log p iterations
◦ In each iteration every process swaps values with partner.
16
Time Complexity Analysis

FFT time complexity O(n log n).

Parallel FFT
◦ Each process controls n/p elements
◦ The overall communication time complexity is O( (n/p) log p)
◦ Computational time complexity of parallel FFT is O(n log n/p)
17
Reference

Quinn,M.J (2004). Parallel programming in C with MPI and OpenMP

Chu, E., & George. A., (2000). Serial and Parallel Fast Fourier Transform
Algorithms

Bi,G & Zeng, Y. (2003). Transforms and Fast Algorithm for Signal Analysis
and Representation.

The Fast Fourier Transform. (n.d.). Retrieved from
http://www.dspguide.com/ch12/2.htm

Chu, E., & George, A., (1999). Inside the FFT black box: serial and
parallel fast Fourier transform algorithms. Boca Raton, Fla.: CRC Press,
1999.
18