DFT and FFT By using the complex roots of unity, we can evaluate and interpolate a polynomial in O(n lg n) An example, here are the solutions to 8 = 1 The principal root is We often write these values in trigonometric form
Properties of Roots of Unity The halving lemma is essential since it guarantees the recursive solutions of subproblems are only half as large
Discrete Fourier Transform We wish to evaluate at the points We can assume n to be a power of 2 by adding high-order zero coefficients as necessary Assuming a = (a0, a1, …, an-1) we define This calculation is O(n2), but by using the complex roots of unity, it can be done in O(n lg n)
Fast Fourier Transform We separate the even and odd index coefficients Our desired result is So to evaluate A(x) at the complex roots of unity
FFT - continued Due to the halving lemma, there are not n distinct values, rather only n/2 complex (n/2)th roots Since the solutions of the subproblems are of the same form as the original problem, these recursive solutions are also only half in size So we can solve an n-element DFTn computation by solving two n/2-element DFTn/2 computations In the following recursive FFT algorithm, we compute the DFT for the vector where n is a power of 2
FFT Algorithm - 1 Lines 2-3 handle the base case Lines 4,5,13 update so that at lines 11-12 we have Lines 6-7 define the coefficient vectors for the subpolynomials
FFT Algorithm - 2 Lines 8-9 solve the subproblems recursively The algorithm complexity is
Interpolation The DFT can be written as the matrix product y = Vna The DFTn-1 can be computed in O(n lg n) time too