Bruun's FFT algorithm: Difference between revisions

Content deleted Content added
Nayuki (talk | contribs)
m Recursive factorizations and FFTs: - Converted mathematical expressions
Line 29:
== Recursive factorizations and FFTs ==
 
In order to compute the DFT, we need to evaluate the remainder of ''<math>x''(''z'')</math> modulo ''N'' degree-1 polynomials as described above. Evaluating these remainders one by one is equivalent to the evaluating the usual DFT formula directly, and requires O(''N''<sup>2</sup>) operations. However, one can ''combine'' these remainders recursively to reduce the cost, using the following trick: if we want to evaluate ''<math>x''(''z'')</math> modulo two polynomials ''<math>U''(''z'')</math> and ''<math>V''(''z'')</math>, we can first take the remainder modulo their product ''<math>U''(''z'')</math> ''<math>V''(''z'')</math>, which reduces the [[degree (mathematics)|degree]] of the polynomial ''<math>x''(''z'')</math> and makes subsequent modulo operations less computationally expensive.
 
The product of all of the monomials <math>(''z'' - ω<sub>''N''</sub><sup>''\omega_N^k'')</supmath>) for ''k''=0..''N''-1 is simply ''z''<supmath>''z^N''-1</supmath>-1 (whose roots are clearly the ''N'' roots of unity). One then wishes to find a recursive factorization of ''z''<supmath>''z^N''-1</supmath>-1 into polynomials of few terms and smaller and smaller degree. To compute the DFT, one takes ''<math>x''(''z'')</math> modulo each level of this factorization in turn, recursively, until one arrives at the monomials and the final result. If each level of the factorization splits every polynomial into an O(1) (constant-bounded) number of smaller polynomials, each with an O(1) number of nonzero coefficients, then the modulo operations for that level take O(''N'') time; since there will be a logarithmic number of levels, the overall complexity is O (''N'' log ''N'').
 
More explicitly, suppose for example that ''z''<supmath>''z^N''</sup>-1 = ''F''<sub>1</sub>F_1(''z'') ''F''<sub>2</sub>F_2(''z'') ''F''<sub>3F_3(z)</submath>(''z''), and that ''F''<sub>''k''</submath>F_k(''z'') = ''F''<sub>''F_{k'',1</sub>}(''z'') ''F''<sub>''F_{k'',2</sub>}(''z'')</math>, and so on. The corresponding FFT algorithm would consist of first computing ''x''<sub>''k''</sub>(''z'') = ''x''(''z'') mod
''F''<sub>''k''</sub>(''z''), then computing ''x''<sub>''k'',''j''</sub>(''z'') = ''x''<sub>''k''</sub>(''z'') mod
''F''<sub>''k'',''j''</sub>(''z''), and so on, recursively creating more and more remainder polynomials of smaller and smaller degree until one arrives at the final degree-0 results.
Line 41:
====Cooley-Tukey as polynomial factorization====
 
The standard decimation-in-frequency (DIF) radix-''r'' Cooley-Tukey algorithm corresponds closely to a recursive factorization. For example, radix-2 DIF Cooley-Tukey factors ''z''<supmath>''z^N''-1</supmath>-1 into ''F''<sub>1</submath>F_1 = (''z''<sup>''^{N''/2}-1)</supmath>-1) and ''F''<sub>2</submath>F_1 = (''z''<sup>''^{N''/2}+1)</supmath>+1). These modulo operations reduce the degree of ''<math>x''(''z'')</math> by 2, which corresponds to dividing the problem size by 2. Instead of recursively factorizing ''F''<submath>2F_2</submath> directly, though, Cooley-Tukey instead first computes ''x''<sub>2</sub>(''z'' ω<sub>''N''</sub>), shifting all the roots (by a ''twiddle factor'') so that it can apply the recursive factorization of ''F''<submath>1F_1</submath> to both subproblems. That is, Cooley-Tukey ensures that all subproblems are also DFTs, whereas this is not generally true for an arbitrary recursive factorization (such as Bruun's, below).
 
== The Bruun factorization ==