J. Comp. & Math. Sci. Vol. 1 (6), 762-765 (2010
Application of Fast Fourier Transforms SARASIJA Department of Mathematics Noorul Islam University, Kumaracoil ABSTRACT In this paper an attempt is made to calculate the coefficient of the product of two polynomials of very large degree using Fast Fourier Transform through Bit Reversal order and Butterfly Diagram. Key words : Fast Fourier Transform, Bit Reversal order, Butterfly Diagram.
1. INTRODUCTION AND PREVIOUS DEFINITIONS: [1] The Fast Fourier Transform (FFT) is an algorithm that efficiently computes the Discrete Fourier Transform (DFT). Direct computation of the N – point DFT requires about O(N2)–complex multiplications. By using FFT algorithms the number of computation can be reduced to O(N logN). If the number of output points N can be expressed as a power of 2 then this algorithm is known as radix-2 FFT algorithm. Definition: [ 1-5] The DFT of a sequence (xk) of length n is given by a complex valued sequence n −1
f(wj) =
∑x
k
2π ijk e n
k =1
j = 0,1,2,…n-1.
Butterfly diagram of DFT is given below
Xr-1(p) W ns
Xr-1(q)
Then f(wj) =
∑x W n =1
k
Xr(q) = Xr-1(p) - Wns Xr-1(q) Inverse Discrete Fourier Transform (IDFT) become n−1
1 n
where
−j n
∑ f (w )W j
j =0
n ,j = 0,1,2,…n-1
The computational algorithm represented by a diagram called “ Butterfly Diagram”
Xr(q)
Xr(p) = Xr-1(p) + Wns Xr-1(q)
xk = j
-Wns
The equation represented by this butterfly diagram are
Let the complex valued phase factor 2 π ik Wn = e n . ∞
Xr(p)
Wn-1
= e
−
2π ik n
, j = 0,1,2,…n-1,
, k= 0, 1, 2,….n-1.
Butterfly diagram of DFT is given below
Journal of Computer and Mathematical Sciences Vol. 1, Issue 6, 31 October, 2010 Pages (636-768)
Sarasija, J. Comp. & Math. Sci. Vol. 1 (6), 762-765 (2010)
763
Yr-1(p)
Yr(p) Wn -s
coefficient of the polynomial to the sequence of values of that polynomial at nth root of unity. Using FFT through butterfly diagram the whole job can be done in time O( n log n ). Product of two polynomials [2]
Yr-1(q)
-Wn
Yr(q)
-s
The Fast Fourier transform makes use of the K+
n 2
symmetry Property Wn = -WnK and Periodicity Property WnK+n = WnK to effectively reduce the DFT computation time. Bit-Reversal: 1.2 [3 - 5] In DFT algorithm we can find that in order for the output sequence to be in natural order ( i.e.,X(k) , k = 0,1,…N-1) the input sequence has to be stored in a shuffled order. For an 8-point DFT algorithm the input sequence is x(0), x(4), x(2),x(6),x(1),x(5),x(3) and x(7). We can see that when N is a power of 2, the input sequence must be stored in bit reversal order for the output to be computed in natural order. Bit-Reversal process for N = 8 is shown in the following table Input sample 0 1 2 3 4 5 6 7
Binary representation 000 001 010 011 100 101 110 111
Bit reversed binary 000 100 010 110 001 101 011 111
Bit reversed sample 0 4 2 6 1 5 3 7
Consider the polynomial of degree n, where n is large, the number of terms in this polynomial is n + 1. Here the coefficient of the polynomial is considered as a sequence x(k). Convert from the sequence of
Consider two polynomials f and g of degree n and m . Degree of the product of fg is n+m. The number of terms in this product is m+n+1.Let N be the smallest integer that is a power of 2 and is just greater than m+n+1. Let the coefficient of the polynomial fg is considered as a sequence Y(j). We should adjoin ((N-1)-n) more coefficient all equal to 0 to the polynomial f and adjoin ((N-1)-m) more coefficient all equal to 0 to the polynomial g. Now we get two polynomials f and g each of whose degree is N-1. Compute the FFT of the array of coefficients f and g. First we calculate values of f and g at the Nth root of unity as f(wj) and g(wj), j = 0,1,…N-1. Then multiply the numbers f(wj) by the numbers g(wj). Now we get the sequence of values h(wj) = f(wj)g(wj), j = 0,1,…N-1, which are exactly the values of the unknown product of the polynomials f and g at the Nth root of unity. We want to get back to the coefficients of fg using Inverse Fast Fourier Transforms through butterfly diagram and bit reversal order Finally we get the sequence Y(k) =
1 y(wk) , N
which are the required coefficients of the polynomial fg. The following diagrams give the example of the polynomials f and g of degree 2 and 3 respectively. Consider N in such a way that n is a power of 2 and just greater than 2+3 ie., N = 8 =23.
Journal of Computer and Mathematical Sciences Vol. 1, Issue 6, 31 October, 2010 Pages (636-768)
Sarasija, J. Comp. & Math. Sci. Vol. 1 (6), 762-765 (2010)
764
(This method is useful for large degree of f and g). adjoin 5 more coefficients equal to 0 to the polynomial f and 4 more coefficients equal to 0 to the polynomial g. A(0)
G(0) f(w0)
x(0) W2
0
W80
W40
G(1)
A(1)
x(4) -W2
f(w1)
0
W41 B(0)
G(2)
x(2) W20 x(6)
W81 f(w2)
-W40
W82 G(3)
-W20
-W41
B(1)
W83 H(0)
C(0)
x(1) W2
-W80
0
W40 H(1) C(1) x(5)
-W20 W4
-W81
1
H(2)
D(0) x(3)
-W40
W20
-W20
f(w6)
H(3)
D(1)
x(7)
f(w6)
-W82
-W41
-W83
Let x(j),j = 0,1,…7 are sequence of coefficient of f. Where W20 =1, W40 = 1, W41 = i, W80 = 1, W81 = 2 − i 2 , W82 = -i , W83 = − 2 − i 2 Similarly we can calculate g(wj) j = 0,1,…7 for the polynomial g. Let f(wj)g(wj) = h(wj), j = 0,1,…7 be the values of the polynomial fg Journal of Computer and Mathematical Sciences Vol. 1, Issue 6, 31 October, 2010 Pages (636-768)
f(w7)
Sarasija, J. Comp. & Math. Sci. Vol. 1 (6), 762-765 (2010)
765
A1(0) A (0)
h(0)
G1(0)
W2-0
-W2
W8-0
W4-0
A1(1)
h(4)
G1(1)
-0
W4-1
h(2) y(7) y(3) W2 B1(1)
y(2) W8-2 G1(3)
-W2-0
-W4
y(3)
-1
H1(0)
C1(0)
y(4) -W8-0
W2-0 h(5)
W8-1
-W4-0
-0
h(1)
y(1)
G1(2)
B1(0)
h(6)
y(0)
W4-0
H1(1) y(5)
C1(1) -W2
-W8-1
-0
W4-1
y(6)
H1(2)
D1(0)) y(3)
-W4-0
W2-0 D1(1)
H1(3)
y(7)
-W8
-W4-1
Required coefficients Y(j) =
1 (y(j) , 8
y(7)
j=
0,1,..7
REFERRENCES 1. J. M. Cooley, P.A.W. Lewis and P.D. Welch, ‘The Fast Fourier Transform and its application to time series analysis in statistical methods for Digital computers, Enslein Ralston and Wilf eds.John Wiley and sons, New York (1977).
-3
2. Herbert. S. Wilf.,” Algorithms and Complexity”, Prentice Hall international. Inc. 3. J. R. Johnson, “Introduction to digital signal processing” Prentice Hall, Engle wood cliffs NJ. 4. A.V. Oppenheim and A.S. Willsky,” Discrete-time signal processing”. Prentice Hall, Engle wood cliffs NJ, 5. J.G.Proakis and D.G.Manolakis ,” digital signal processing, principles, Algorithams, and applications” Prentice Hall, Engle wood cliffs NJ, second edition, (1992).
Journal of Computer and Mathematical Sciences Vol. 1, Issue 6, 31 October, 2010 Pages (636-768)