Bruun's algorithm is a fast Fourier transform (FFT) algorithm based on an unusual recursive polynomial-factorization approach, proposed for powers of two by G. Bruun in 1978 and generalized to arbitrary even composite sizes by H. Murakami in 1996. Because its operations involve only real coefficients until the last computation stage, it was initially proposed as a way to efficiently compute the discrete Fourier transform (DFT) of real data. Bruun's algorithm has not seen widespread use, however, as approaches based on the ordinary CooleyâÂÂTukey FFT algorithm have been successfully adapted to real data with at least as much efficiency. Furthermore, there is evidence that Bruun's algorithm may be intrinsically less accurate than CooleyâÂÂTukey in the face of finite numerical precision .
Nevertheless, Bruun's algorithm illustrates an alternative algorithmic framework that can express both itself and the CooleyâÂÂTukey algorithm, and thus provides an interesting perspective on FFTs that permits mixtures of the two algorithms and other generalizations.
Recall that the DFT is defined by the formula:
For convenience, let us denote the N roots of unity by ÃÂ<sub>N</sub><sup>n</sup> (n = 0, ..., N − 1):
and define the polynomial x(z) whose coefficients are x<sub>n</sub>:
The DFT can then be understood as a reduction of this polynomial; that is, X<sub>k</sub> is given by:
where mod denotes the polynomial remainder operation. The key to fast algorithms like Bruun's or CooleyâÂÂTukey comes from the fact that one can perform this set of N remainder operations in recursive stages.
In order to compute the DFT, we need to evaluate the remainder of 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 modulo two polynomials and , we can first take the remainder modulo their product , which reduces the degree of the polynomial and makes subsequent modulo operations less computationally expensive.
The product of all of the monomials for k=0..N-1 is simply (whose roots are clearly the N roots of unity). One then wishes to find a recursive factorization of into polynomials of few terms and smaller and smaller degree. To compute the DFT, one takes 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 , and that , 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.
Moreover, as long as the polynomial factors at each stage are relatively prime (which for polynomials means that they have no common roots), one can construct a dual algorithm by reversing the process with the Chinese remainder theorem.
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 into and . These modulo operations reduce the degree of by 2, which corresponds to dividing the problem size by 2. Instead of recursively factorizing 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 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 basic Bruun algorithm for powers of two N=2<sup>n</sup> factorizes z<sup>2<sup>n</sup></sup>-1 recursively via the rules:
where a is a real constant with |a| ⤠2. If , , then and .
At stage s, s=0,1,2,n-1, the intermediate state consists of 2<sup>s</sup> polynomials of degree 2<sup>n-s</sup> - 1 or less , where
By the construction of the factorization of z<sup>2<sup>n</sup></sup>-1, the polynomials p<sub>s,m</sub>(z) each encode 2<sup>n-s</sup> values
of the Fourier transform, for m=0, the covered indices are k=0, 2<sup>k</sup>, 2âÂÂ2<sup>s</sup>, 3âÂÂ2<sup>s</sup>,..., (2<sup>n-s</sup>-1)âÂÂ2<sup>s</sup>, for m>0 the covered indices are k=m, 2<sup>s+1</sup>-m, 2<sup>s+1</sup>+m, 2âÂÂ2<sup>s+1</sup>-m, 2âÂÂ2<sup>s+1</sup>+m, ..., 2<sup>n</sup>-m.
During the transition to the next stage, the polynomial is reduced to the polynomials and via polynomial division. If one wants to keep the polynomials in increasing index order, this pattern requires an implementation with two arrays. An implementation in place produces a predictable, but highly unordered sequence of indices, for example for N=16 the final order of the 8 linear remainders is (0, 4, 2, 6, 1, 7, 3, 5).
At the end of the recursion, for , there remain linear polynomials encoding two Fourier coefficients and for the first and for the any other th polynomial the coefficients and .
At each recursive stage, all of the polynomials of the common degree are reduced to two parts of half the degree . The divisor of this polynomial remainder computation is a quadratic polynomial z<sup>m</sup>, so that all reductions can be reduced to polynomial divisions of cubic by quadratic polynomials. There are of these small divisions at each stage, leading to an algorithm for the FFT.
Moreover, since all of these polynomials have purely real coefficients (until the very last stage), they automatically exploit the special case where the inputs x<sub>n</sub> are purely real to save roughly a factor of two in computation and storage. One can also take straightforward advantage of the case of real-symmetric data for computing the discrete cosine transform .
The Bruun factorization, and thus the Bruun FFT algorithm, was generalized to handle arbitrary even composite lengths, i.e. dividing the polynomial degree by an arbitrary radix (factor), as follows. First, we define a set of polynomials for positive integers and for in by:
Note that all of the polynomials that appear in the Bruun factorization above can be written in this form. The zeroes of these polynomials are for in the case, and for in the case. Hence these polynomials can be recursively factorized for a factor (radix) via: