Professional Documents
Culture Documents
Project Report
Submitted in fulfilment of Course
Saket Agarwal
ID No. 2012B5A8358G
Where
and
is given by
form of Equation 8.24 would typically require O(N2) basic operations, the
optimized fast Fourier transform (FFT) algorithm requires O(N log 2 N) operations
only.
To compute FFT let us start with Danielson Lanczos lemma
Note it is a DFT broken up into two summations of half the size of the original.
The first summation is the "even terms", E, and the second is the "odd terms", O.
W is the "twiddle factor", and understanding it is another key to understanding
the FFT. Here is the "twiddle factor".
To expand the DFT into even and odd terms as in the lemma above, you do the
following. For the even term you substitute 2k into k, then you create a
summation of half the size of the original. For the odd term you substitute 2k + 1
into k, then create a summation of half the size of the original.
The example below shows the process required for a first level expansion.
The above is a first level break down. You can continue to break each term down
into even and odd terms until you run out of samples and only have one value in
the summation.
As shown in the diagram above, the D-L Lemma breaks down in a binary manner.
That is, the number of terms expands as follows 1, 2, 4, 8, 16, 32, etc. In order to
get all of the summation to unity, 1, therefore, we must have a power of base 2
number of samples, or N=2n samples. So, an FFT requires N = 2n samples.
For a sample size of N=2, a first level expansion will be enough to get the
summations to unity. The first level expansion will look like this
all that remains is a twiddle factor and input values, x(0) and x(1). This is the
general form used for the Butterfly diagram.
Now, N = 4 samples, and using the same procedure as was used for two
samples, the equation becomes:
and all you have remaining are "twiddle factors" and the input values, x(0), x(1),
x(2), and x(3).
After the expansion above you can plug in for N = 8 samples, and k=0, since all
summation would be unity when N=8.
The order in which the terms occur in the above equation is not in natural order
but an order called reverse binary order.
Count from 0 to 7 in binary 000, 001, 010, 011, 100, 101, 110, 111. Now, reverse
the bits of each number and you get 000, 100, 010, 110, 001, 101, 011, 111. In
decimal this sequence is 0, 4, 2, 6, 1, 5, 3, and 7.
So, the values in the D-L equation for 8 samples would be x(0), x(4), x(2), x(6),
x(1), x(5), x(3), and x(7).
The same pattern holds for all expansions of the D-L Lemma, and is made use of
by the Butterfly Diagram.
TWIDDLE FACTOR
The twiddle factor, W, describes a "rotating vector", which rotates in increments
according to the number of samples, N. Here are graphs where N = 2, 4 and 8
samples.
As shown in the diagram above, the twiddle factor has redundancy in values as
the vector rotates around. For example W for N=2, is the same for n = 0, 2, 4, 6,
etc. And W for N=8 is the same for n = 3, 11, 19, 27, etc.
Also, the symmetry is the fact that values that are 180 degrees out of phase are
the negative of each other. So for example, W for N =4 samples, where n =
0,4,8, etc, are the negative of n = 2,6,10, etc.
The Butterfly diagram takes advantage of this redundancy and symmetry, which
is part of what makes the FFT possible.
BUTTERFLY DIAGRAM
The Butterfly Diagram builds on the Danielson-Lanczos Lemma and the twiddle
factor to create an efficient algorithm. The Butterfly Diagram is the
FFT algorithm represented as a diagram.
First, here is the simplest butterfly. It's the basic unit, consisting of just two
inputs and two outputs.
F(0)
X(0)
X(1)
W 02
-1
F(1)
The four output equations for the butterfly are derived below :
N log N Savings
Remember, for a straight DFT you needed N*N multiplies. The N Log N savings
comes from the fact that there are two multiplies per Butterfly. In the 4 input
diagram above, there are 4 butterflies. so, there are a total of 4*2 = 8 multiplies.
4 Log(4) = 8. This is how you get the computational savings in the
FFT! The log is base 2.
Calculating DFT from above set of equations :
1W 04 W 02 W 04 W 02
DFT4 =
11 11
1W 14W 02W 14 W 02
1W 04 W 02W 04 W 02
1
1W 4 W 2 W 4 W 2
1i1i
11 11
1i1 i
For completeness lets look at the butterfly diagram for 8-point FFT :
An The 8 input butterfly diagram has 12 2-input butterflies and thus 12*2 = 24
multiplies.
N Log N = 8 Log (8) = 24. A straight DFT has N*N multiplies, or 8*8 = 64
multiplies. That's a pretty good savings for a small sample. The savings are over
100 times for N = 1024, and this increases as the number of samples increases.
COMPLEXITY
1.) By Standard Method:
T (N ) = 2T (N=2) + O(N )
N = n2
The efficiency of the above circuit is related to the
number of basic gate operations required per input bit.
We can easily see that this is,
n H -gates and
n(n - 1) / 2 C-R-gates for n bits
Hence, Complexity of QFT is O(n2). This is exponentially faster than the
classical FFT which takes O(n2n) operations.
But we must observe, that the output of the quantum Fourier transform is a
superposition of basis states whose phases represent the Fourier transform of
the corresponding input bit. A measurement at the end of the above circuit gives
us no information whatsoever about the Fourier transform of the input! So we
cannot use this circuit as a super-efficient Fourier transform computer! Instead,
we have to incorporate it in procedures that require FT-dependent phases.