The DFT and FFT
Complex roots of unity ( nth root ) w
n = 1. There are n, nth roots of unity.
e( 2 p i / n )
k , k = 0, 1, ..., n-1
recall ei u = cos ( u ) + i sin ( u ) is a point
on the complex unit circle. wn
= e( 2 p i / n ) is the
principal nth root of unity.wn0,
wn1, wn2,
..., wnn-1 are the n, nth
roots of unity. They form a group under multiplication ( Zn,
t )
wnn =
wn0 = 1
wnj wnk
= wn( j+k) ( mod n )
wn-1
= wnn-1
Cancellation Lemma:
For all integers n, k ³ 0, d
> 0 wd nd k = wnk
Proof:
wd nd k =
e( 2 p i / dn ) dk =
e( 2 p i / dn
) dk = e( 2 p
i / n ) k = wnk
Corollary for n > 0, even wnn/2
= w2 = -1
Halving Lemma:
If n > 0 is even, then the squares of the n, nth
roots of unity, are the n/2, n/2th roots of unity.
(wnk )2
= e( 2 p i / n ) 2k = e( 2 p
i / n/2 ) k = wn/2k
We get them twice are
(wnk+n/2 )2
= wn2k+n = wn2k
wnn = wn2k
= wn/2k
so (wnk+n/2 )2
= (wnk )2 and
wnk+n/2 = wnk
wnn/2 =
- wnk
Summation Lemma:
For all n ³ 1, k > 0 with k
not divisible by n we have
n
- 1
å
j = 0 |
(wnk
)j = 0 |
|
Proof:
Note that this a geometric series with x = wnk
, then recall:
n
- 1
å
j = 0 |
Zj =
( Zn - 1) / ( Z -1 ) |
|
here Z = wnk so sum
equals ( (wnk )n
- 1) / ( (wnk ) -1 ).
since k does not divide n (wnk )
¹ 1, but (wnk
)n = (wnk
)n = (wnn
)k = 1k = 1 , so:
n
- 1
å
j = 0 |
(wnk
)j = 0 |
The DFT
We want to evaluate A ( x ) =
at the nth root of unity: wn0,
wn1, wn2,
..., wnn-1 . Consider n as
a power-of-two, n is the degree bound, and can be achieved with zero
padding. Using the coefficient representation of A, a = (a0, a1,
...,an-1), we want yk = A ( wnk
) =
n
- 1
å
j = 0 |
aj (wnk
)j , k = 0, 1, ..., n-1 |
the vector y = (y0, y1, ...,yn-1) is
called the Discrete Fourier Transform ( DFT ) of the vector a.
y = DFTn ( a ) , where n is the size of the vector
The Fast Fourier Transform
Use a divide-and-conquer strategy. Since n is a power-of-two, we can
split the A ( x ) polynomial into a polynomial of even and odd powers:
even coefficients: A [0] ( x ) = a0+ a2
x+ a4 x2+ ... + an-2 xn/2-1 .
odd coefficients: A[1] ( x ) = a1+ a3
x+ a5 x2+ ... + an-1 xn/2-1 .
We can get A ( x ) back as follows:
A ( x ) = A[0] ( x2 ) + A [1] ( x2
) *
so to evaluate A ( x ) at ( wn0,
wn1, ..., wnn-1
) reduces to evaluating A[0] ( x ) at ( (wn0)2,
(wn1)2, ... (wnn-1)2
) and A[1] ( x ) at the same points, and then combine
using *. Note by the halving lemma ( (wn0)2,
(wn1)2, ... (wnn-1)2
) are the n/2, n/2throots of unity, twice!! So A ( x) is
evaluated at n points A[0] ( x ) and A[1] ( x ) are
evaluated at n/2 points, but we can recursively continue, dividing by 2 the
wole way.
Recursive-FFT ( a )
- n ¬ length[a] // n is a
power of 2
- if n = 1
- then return a
- wn ¬ e(
2 p i / n )
- w ¬ 1
- a[0] ¬ (a0, a1,
...,an-2)
- a[1] ¬ (a0, a1,
...,an-1)
- y [0] ¬ Recursive-FFT ( a[0]
)
- y [1] ¬ Recursive-FFT ( a[1])
- for k ¬ 0 to n/2 - 1
- do yk ¬ yk[0]
+ wyk [1]
- yk+n/2
¬ yk[0] - wyk
[1]
-
w ¬ wwn
- return y // y is assumed to be column vector.
This is a divide-and-conquer, halving the size of the FFT each time.
Note that the DFT of a single element is y0
= a0 w10 =
a0 , identity. Lines 6 and 7 setup the A[0] and A[1]
coefficients, lines 8 and 9 are the recursion, lines 10 - 13 do the
recombination via *, and lines 4 and 5 make sure the right nth
root of unity is used. Line 11 does the first half, 0 to n/2 - 1, line 12
does the second half, n/2 to n-1. Note the w used
in this loop is wnk but
wnk+n/2 = wnk
wnn/2 = - wnk
.
The running time satisfies: T ( n ) = 2 T ( n/2 ) + Q
(n) so T ( n ) = Q (n lg n)
where the 2 T is the 2 FFT's and the Q (n)
is loops 10 - 13.
Interpolation
The DFT can be written as:
y = Vn ( wn0,
wn1, wn2,
..., wnn ) a
the ( k, j ) entry of Vn is Vn|(
k, j ) = wnkj we can
interpolate by inverting:
a = Vn-1 ( wn0,
wn1, wn2,
..., wnn ) y
= DFTn-1 ( y )
But it is easy to compute Vn-1.
Theorem:
For j, k = 0, 1, ..., n - 1 Vn-1|(
k, j ) = (wn-kj ) /
n
Proof:
We show that with this definition Vn-1Vn
= I , the identity, or Vn-1Vn|(
k, j ) = d ( j, j' ) = { 1 if j = j' or 0
otherwise.
= |
n
- 1
å
j = 0 |
(wn-kj
) / n wnkj-1 |
|
if j j' then:
n
- 1
å
j = 0 |
wnk(j'-j)
= |
|
n
- 1
å
j = 0 |
( wnk(j'-j))k |
|
= 0 |
by the summation lemma. If j' = j then wnk(j'-j)
= wn0 = 1 so:
1/n |
n
- 1
å
j = 0 |
wnk(j'-j)
= |
|
|
= n/n = 1 |
Thus aj = 1/n |
n
- 1
å
j = 0 |
yk (wn-kj
) |
|
which is like a DFT except:
- role of a and y are reversed
- wn is replaced by wn-1
- the result is devided by n
thus we can perform this in Q (n
lg n) with a suitably modified Recursive-FFT. Call this:
a = DFTn-1 ( y )
Convolution Theorem:
a Ä b = DFT2n-1 (
DFT2n-1 ( a ) . DFT2n-1
( b )) , Ä is polynomial multiplication
|