Docsity

Fast Fourier Transform: Algorithm and Implementation, Study notes of Computer Science

Partial preview of the text

Download Fast Fourier Transform: Algorithm and Implementation and more Study notes Computer Science in PDF only on Docsity!

Fast Fourier Transform

Consider two polynomials: A(x) = a 0 + a 1 x + · · · + an− 1 xn−^1 and B(x) = b 0 + b 1 x + · · · + bn− 1 xn−^1. Let their product be C(x) = c 0 + c 1 x + · · · + c 2 n− 2 x^2 n−^2. For all 0 ≤ 2 n − 2, the coefficient ck of C(x) is: ck = a 0 bk + a 1 bk− 1 + · · · + akb 0 = i∑ = 0^ k aibk−i. (Assume that, for i ≥ n, ai and bi are zero.)

Takes O(n^2 ) multiplications.

Fast Fourier Transform

A polynomial of degree d is uniquely characterized by its values at d + 1 distinct points. Let x 0 , x 1 ,... , x 2 n− 2 be 2n − 1 distinct points. Let A(x 0 ), A(x 1 ),... , A(x 2 n− 2 ) be the values of the polynomial A(x) at these 2n − 1 points. Let B(x 0 ), B(x 1 ),... , B(x 2 n− 2 ) be the values of the polynomial B(x) at these 2n − 1 points. Then, the values of the product polynomial C(x) at these 2n − 1 points is : C(xi) = A(xi) × B(xi) for 0 ≤ i ≤ 2 n − 2.

Fast Fourier Transform: evaluation

Assume that the number of coefficients N is a power of 2.

Express A(x) as: [a 0 + a 2 x^2 + · · · + aN − 2 xN^ −^2 ] + x [a 1 + a 3 x^2 + · · · + aN − 1 xN^ −^2 ]

Let Ae(x^2 ) = a 0 + a 2 x^2 + · · · + aN − 2 xN^ −^2. Let Ao(x^2 ) = a 1 + a 3 x^2 + · · · + aN − 1 xN^ −^2. Then, A(x) = Ae(x^2 ) + x Ao(x^2 ). Suppose the points are such that xj = − xN 2 +j for 0 ≤ j ≤ N 2 − 1: symmetry.

  • Evaluate Ae(xj 2 ) and Ao(xj 2 ) for 0 ≤ j ≤ N 2 − 1.
  • For 0 ≤ j ≤ N 2 − 1, form: A(xj ) = Ae(xj 2 ) + xj Ao(xj 2 ) A(xj+ N 2 ) = Ae(xj 2 ) − xj Ao(xj 2 ).

Number of multiplications reduces by a factor of 2. Evaluating Ae(x^2 ) same problem with half the number of coefficients and half the number of points. Need points that satisfy the symmetry property recursively.

Fast Fourier Transform: roots of unity

Consider the equation xN^ − 1 = 0. N distinct roots expressible as : 1 , ω, ω^2 ,... , ωN^ −^1 ω = e^2 πN^ i: principal N -th root of unity.

Let xi = ωi^ for 0 ≤ i ≤ N − 1. Properties of a principal N -th root of unity.:

  • ωN^ = 1.
  • ωj^6 = 1 for 1 ≤ j ≤ N − 1.
  • ωj^ = − ω N^2 j^ for 0 ≤ j ≤ N 2 − 1.

If w is a principal N -th root of unity, w^2 is a principal N 2 th- root of unity.

Fast Fourier Transform: Algorithm

To form the R, the values of the product polynomial C(x) at the N points ωj^ for 0 ≤ j ≤ N − 1.

FFTEvaluation(A(x), ω, U ). FFTEvaluation(B(x), ω, V ). For 0 ≤ j N − 1 do: R[j] = U [j] × V [j].

Fast Fourier Transform: Evaluation as Matrix vector product

FFT evaluates the polynomial A(x) at 1, ω, ω^2 ,... , ωN^ −^1. A is the vector of coefficients of A(x). Result in vector U. Let W be the N × N matrix whose (j, k)-th entry is ωjk. Vector U with values of polynomial A(x) at 1, ω, ω^2 ,... , ωN^ −^1 is: W × A = U.

Fast Fourier Transform: Inverse Transform

Values of the product C(x) of A(x) and B(x) in the vector R. Let C be the vector of (unknown) coefficients of C(x). Then, W × C = R

To get C given R: C = W−^1 R

Let: WIjk = ( ω^1 )jk. for 0 ≤ j, k ≤ N − 1. Form the product of W with WI: (W × WI)jk = 0 if j 6 = k. (W × WI)jk = N if j = k. Conclude that: W−^1 = (^) N^1 WI.