CS 662 Theory of Parallel Algorithms
Numerical Method part 4 FFT
[To Lecture Notes Index]
San Diego State University -- This page last updated May 7, 1996
Who is Fourier?How did he get so Fast?Who cares?
Bases for 3-dimension points: (x, y, z)
Bases for functions:
- Polynomials
-
-
-
- Fourier bases
-
k = 0, 1, ...
-
-
k = 0, 1, ...
-
- Then the Fourier transform of f(x) is:
-
Example
- f(x) = | x | for
-
- The Fourier transform of f(x) is:
-
-
Complex numbers, X-Y plane and all that
Let
represent the unit vector in the y-axis
Represent points in the plane as x +
y
So (1/2, 1) is 1/2 +
Thus (a +
b)(c
+
d)
= ac+
bd
+
(b+d)
but
,
so
(a +
b)(c
+
d)
= ac-bd +
(bc+ad)
Roots of Unity
Define
as:
-
where
then
-
The n'th roots of unity are:
-
Example
Let n = 4 then
Example
Let n = 8 then
Discrete vs. Continuous (DFT vs FT)
Let
Define
for j,k = 0, 1, ..., n-1
If n = 4 then
Let x be an n-dimensional vector, the discrete Fourier transform (DFT) of x is
the vector:
-
Then
-
Note
defines
We have
Now the Fast Part
Assume n is a power of 2 and compute
Since
we have
-
But this is the 2p'th component of the DFT of the vector:
-
Similarly we get:
-
But this is the 2p+1'th component of the DFT of the vector:
-
This means to compute the DFT of an n vector we can compute the DFT of two n/2
vectors.
Computing DFT
Theorem
- The above processes will compute the DFT of an n-dimensional vector in
O(log(n)) time using total of O(nlog(n)) operations
- The inverse DFT of an n-dimensional vector can be computed in O(log(n))
time using total of O(nlog(n)) operations
Example Use of FFT
Polynomial Multiplication
Let
and
Let
where
So can compute
in parallel using log(n+m) time and performing O(mn) operations using scan and
n*n processors
Using FFT
Let
and
Compute
and
where
-
-
-
-
Compute
Compute
where
-
-
Then
for k = 0, 1, ..., n+m-1
So
can be computed in O( log(n+m) ) time and O( (n+m)log(n+m) ) operations using
O(n) processors