# GetWiki

### fast Fourier transform

ARTICLE SUBJECTS
news  →
unix  →
wiki  →
ARTICLE TYPES
feed  →
help  →
wiki  →
ARTICLE ORIGINS fast Fourier transform
[ temporary import ]
- the content below is remote from Wikipedia
- it has been imported raw for GetWiki
{{redirect|FFT}}{{Use American English|date=March 2019}}{{Short description|O(n logn) divide and conquer algorithm to calculate the discrete Fourier transforms}}{{bots|deny=Citation bot}}(File:DIT-FFT-butterfly.png|thumb|An example FFT algorithm structure, using a decomposition into half-size FFTs)(File:FFT of Cosine Summation Function.png|thumb|A discrete Fourier analysis of a sum of cosine waves at 10, 20, 30, 40, and 50 Hz)A fast Fourier transform (FFT) is an algorithm that computes the discrete Fourier transform (DFT) of a sequence, or its inverse (IDFT). Fourier analysis converts a signal from its original domain (often time or space) to a representation in the frequency domain and vice versa. The DFT is obtained by decomposing a sequence of values into components of different frequencies. This operation is useful in many fields, but computing it directly from the definition is often too slow to be practical. An FFT rapidly computes such transformations by factorizing the DFT matrix into a product of sparse (mostly zero) factors. As a result, it manages to reduce the complexity of computing the DFT from O(n^2), which arises if one simply applies the definition of DFT, to O(n log n), where n is the data size. The difference in speed can be enormous, especially for long data sets where N may be in the thousands or millions. In the presence of round-off error, many FFT algorithms are much more accurate than evaluating the DFT definition directly. There are many different FFT algorithms based on a wide range of published theories, from simple complex-number arithmetic to group theory and number theory.Fast Fourier transforms are widely used for applications in engineering, science, and mathematics. The basic ideas were popularized in 1965, but some algorithms had been derived as early as 1805. In 1994, Gilbert Strang described the FFT as "the most important numerical algorithm of our lifetime", and it was included in Top 10 Algorithms of 20th Century by the IEEE journal Computing in Science & Engineering. In practice, the computation time can be reduced by several orders of magnitude in such cases, and the improvement is roughly proportional to N/ log N. This huge improvement made the calculation of the DFT practical; FFTs are of great importance to a wide variety of applications, from digital signal processing and solving partial differential equations to algorithms for quick multiplication of large integers.The best-known FFT algorithms depend upon the factorization of N, but there are FFTs with O(N log N) complexity for all N, even for prime N. Many FFT algorithms only depend on the fact that e^{-2pi i/N} is an N-th primitive root of unity, and thus can be applied to analogous transforms over any finite field, such as number-theoretic transforms. Since the inverse DFT is the same as the DFT, but with the opposite sign in the exponent and a 1/N factor, any FFT algorithm can easily be adapted for it.

## History

The development of fast algorithms for DFT can be traced to Gauss's unpublished work in 1805 when he needed it to interpolate the orbit of asteroids Pallas and Juno from sample observations. His method was very similar to the one published in 1965 by Cooley and Tukey, who are generally credited for the invention of the modern generic FFT algorithm. While Gauss's work predated even Fourier's results in 1822, he did not analyze the computation time and eventually used other methods to achieve his goal.Between 1805 and 1965, some versions of FFT were published by other authors. Frank Yates in 1932 published his version called interaction algorithm, which provided efficient computation of Hadamard and Walsh transforms. Yates' algorithm is still used in the field of statistical design and analysis of experiments. In 1942, G. C. Danielson and Cornelius Lanczos published their version to compute DFT for x-ray crystallography, a field where calculation of Fourier transforms presented a formidable bottleneck. While many methods in the past had focused on reducing the constant factor for O(n^2) computation by taking advantage of "symmetries", Danielson and Lanczos realized that one could use the "periodicity" and apply a "doubling trick" to get O(n log n) runtime.James Cooley and John Tukey published a more general version of FFT in 1965 that is applicable when N is composite and not necessarily a power of 2. Tukey came up with the idea during a meeting of President Kennedy's Science Advisory Committee where a discussion topic involved detecting nuclear tests by the Soviet Union by setting up sensors to surround the country from outside. To analyze the output of these sensors, a fast Fourier transform algorithm would be needed. In discussion with Tukey, Richard Garwin recognized the general applicability of the algorithm not just to national security problems, but also to a wide range of problems including one of immediate interest to him, determining the periodicities of the spin orientations in a 3-D crystal of Helium-3. Garwin gave Tukey's idea to Cooley (both worked at IBM's Watson labs) for implementation. Cooley and Tukey published the paper in a relatively short time of six months. As Tukey did not work at IBM, the patentability of the idea was doubted and the algorithm went into the public domain, which, through the computing revolution of the next decade, made FFT one of the indispensable algorithms in digital signal processing.

## Definition

Let x0, ...., xNâˆ’1 be complex numbers. The DFT is defined by the formula
X_k = sum_{n=0}^{N-1} x_n e^{-i2pi k n/N} = sum_{n=0}^{N-1} x_n w^{- k n}
qquadk = 0,dots,N-1. where w = e^{i 2pi/N} is the first complex N-th root of 1.Evaluating this definition directly requires O(n^2) operations: there are N outputs Xk, and each output requires a sum of N terms. An FFT is any method to compute the same results in O(n log n) operations. All known FFT algorithms require Î˜(n log n) operations, although there is no known proof that a lower complexity score is impossible.To illustrate the savings of an FFT, consider the count of complex multiplications and additions for N=4096 data points. Evaluating the DFT's sums directly involves N2 complex multiplications and N(Nâˆ’1) complex additions, of which O(n) operations can be saved by eliminating trivial operations such as multiplications by 1, leaving about 30 million operations. On the other hand, the radix-2 Cooleyâ€“Tukey algorithm, for N a power of 2, can compute the same result with only (N/2)log2(N) complex multiplications (again, ignoring simplifications of multiplications by 1 and similar) and N log2(N) complex additions, in total about 30,000 operations - a thousand times less than with direct evaluation. In practice, actual performance on modern computers is usually dominated by factors other than the speed of arithmetic operations and the analysis is a complicated subject (see, e.g., Frigo & Johnson, 2005), but the overall improvement from O(n^2) to O(n log n) remains.

## Algorithms

### Cooleyâ€“Tukey algorithm

By far the most commonly used FFT is the Cooleyâ€“Tukey algorithm. This is a divide and conquer algorithm that recursively breaks down a DFT of any composite size N = N1N2 into many smaller DFTs of sizes N1 and N2, along with O(N) multiplications by complex roots of unity traditionally called twiddle factors (after Gentleman and Sande, 1966).This method (and the general idea of an FFT) was popularized by a publication of Cooley and Tukey in 1965, but it was later discovered that those two authors had independently re-invented an algorithm known to Carl Friedrich Gauss around 1805 (and subsequently rediscovered several times in limited forms).The best known use of the Cooleyâ€“Tukey algorithm is to divide the transform into two pieces of size N/2 at each step, and is therefore limited to power-of-two sizes, but any factorization can be used in general (as was known to both Gauss and Cooley/Tukey). These are called the radix-2 and mixed-radix cases, respectively (and other variants such as the split-radix FFT have their own names as well). Although the basic idea is recursive, most traditional implementations rearrange the algorithm to avoid explicit recursion. Also, because the Cooleyâ€“Tukey algorithm breaks the DFT into smaller DFTs, it can be combined arbitrarily with any other algorithm for the DFT, such as those described below.

### Other FFT algorithms

nk = -frac{(k-n)^2} 2 + frac{n^2} 2 + frac{k^2} 2.
Hexagonal Fast Fourier Transform aims at computing an efficient FFT for the hexagonally sampled data by using a new addressing scheme for hexagonal grids, called Array Set Addressing (ASA).

## FFT algorithms specialized for real and/or symmetric data

In many applications, the input data for the DFT are purely real, in which case the outputs satisfy the symmetry
X_{N-k} = X_k^*
and efficient FFT algorithms have been designed for this situation (see e.g. Sorensen, 1987). One approach consists of taking an ordinary algorithm (e.g. Cooleyâ€“Tukey) and removing the redundant parts of the computation, saving roughly a factor of two in time and memory. Alternatively, it is possible to express an even-length real-input DFT as a complex DFT of half the length (whose real and imaginary parts are the even/odd elements of the original real data), followed by O(N) post-processing operations.It was once believed that real-input DFTs could be more efficiently computed by means of the discrete Hartley transform (DHT), but it was subsequently argued that a specialized real-input DFT algorithm (FFT) can typically be found that requires fewer operations than the corresponding DHT algorithm (FHT) for the same number of inputs. Bruun's algorithm (above) is another method that was initially proposed to take advantage of real inputs, but it has not proved popular.There are further FFT specializations for the cases of real data that have even/odd symmetry, in which case one can gain another factor of (roughly) two in time and memory and the DFT becomes the discrete cosine/sine transform(s) (DCT/DST). Instead of directly modifying an FFT algorithm for these cases, DCTs/DSTs can also be computed via FFTs of real data combined with O(N) pre/post processing.

## Computational issues

### Approximations

All of the FFT algorithms discussed above compute the DFT exactly (i.e. neglecting floating-point errors). A few "FFT" algorithms have been proposed, however, that compute the DFT approximately, with an error that can be made arbitrarily small at the expense of increased computations. Such algorithms trade the approximation error for increased speed or other properties. For example, an approximate FFT algorithm by Edelman et al. (1999) achieves lower communication requirements for parallel computing with the help of a fast multipole method. A wavelet-based approximate FFT by Guo and Burrus (1996) takes sparse inputs/outputs (time/frequency localization) into account more efficiently than is possible with an exact FFT. Another algorithm for approximate computation of a subset of the DFT outputs is due to Shentov et al. (1995). The Edelman algorithm works equally well for sparse and non-sparse data, since it is based on the compressibility (rank deficiency) of the Fourier matrix itself rather than the compressibility (sparsity) of the data. Conversely, if the data are sparseâ€”that is, if only K out of N Fourier coefficients are nonzeroâ€”then the complexity can be reduced to O(K log(N)log(N/K)), and this has been demonstrated to lead to practical speedups compared to an ordinary FFT for N/K > 32 in a large-N example (N = 222) using a probabilistic approximate algorithm (which estimates the largest K coefficients to several decimal places).

### Accuracy

Even the "exact" FFT algorithms have errors when finite-precision floating-point arithmetic is used, but these errors are typically quite small; most FFT algorithms, e.g. Cooleyâ€“Tukey, have excellent numerical properties as a consequence of the pairwise summation structure of the algorithms. The upper bound on the relative error for the Cooleyâ€“Tukey algorithm is O(Îµ log N), compared to O(ÎµN3/2) for the naÃ¯ve DFT formula, where Îµ is the machine floating-point relative precision. In fact, the root mean square (rms) errors are much better than these upper bounds, being only O(Îµ {{radic|log N}}) for Cooleyâ€“Tukey and O(Îµ {{radic|N}}) for the naÃ¯ve DFT (Schatzman, 1996). These results, however, are very sensitive to the accuracy of the twiddle factors used in the FFT (i.e. the trigonometric function values), and it is not unusual for incautious FFT implementations to have much worse accuracy, e.g. if they use inaccurate trigonometric recurrence formulas. Some FFTs other than Cooleyâ€“Tukey, such as the Raderâ€“Brenner algorithm, are intrinsically less stable.In fixed-point arithmetic, the finite-precision errors accumulated by FFT algorithms are worse, with rms errors growing as O({{radic|N}}) for the Cooleyâ€“Tukey algorithm (Welch, 1969). Moreover, even achieving this accuracy requires careful attention to scaling to minimize loss of precision, and fixed-point FFT algorithms involve rescaling at each intermediate stage of decompositions like Cooleyâ€“Tukey.To verify the correctness of an FFT implementation, rigorous guarantees can be obtained in O(N log N) time by a simple procedure checking the linearity, impulse-response, and time-shift properties of the transform on random inputs (ErgÃ¼n, 1995).

## Multidimensional FFTs

As defined in the multidimensional DFT article, the multidimensional DFT
X_mathbf{k} = sum_{mathbf{n}=0}^{mathbf{N}-1} e^{-2pi i mathbf{k} cdot (mathbf{n} / mathbf{N})} x_mathbf{n}
transforms an array xn with a d-dimensional vector of indices mathbf{n}=(n_1, ldots, n_d) by a set of d nested summations (over n_j = 0 ldots N_j-1 for each j), where the division n/N, defined as mathbf{n} / mathbf{N} = (n_1/N_1, ldots, n_d/N_d), is performed element-wise. Equivalently, it is the composition of a sequence of d sets of one-dimensional DFTs, performed along one dimension at a time (in any order).This compositional viewpoint immediately provides the simplest and most common multidimensional DFT algorithm, known as the row-column algorithm (after the two-dimensional case, below). That is, one simply performs a sequence of d one-dimensional FFTs (by any of the above algorithms): first you transform along the n1 dimension, then along the n2 dimension, and so on (or actually, any ordering works). This method is easily shown to have the usual O(N log N) complexity, where N = N_1 cdot N_2 cdot ldots cdot N_d is the total number of data points transformed. In particular, there are N/N1 transforms of size N1, etcetera, so the complexity of the sequence of FFTs is:
begin{align}
& frac{N}{N_1} O(N_1 log N_1) + cdots + frac{N}{N_d} O(N_d log N_d) [6pt]

# {} & Oleft(N left[log N_1 + cdots + log N_dright]right) O(N log N).

end{align}In two dimensions, the xk can be viewed as an n_1 times n_2 matrix, and this algorithm corresponds to first performing the FFT of all the rows (resp. columns), grouping the resulting transformed rows (resp. columns) together as another n_1 times n_2 matrix, and then performing the FFT on each of the columns (resp. rows) of this second matrix, and similarly grouping the results into the final result matrix.In more than two dimensions, it is often advantageous for cache locality to group the dimensions recursively. For example, a three-dimensional FFT might first perform two-dimensional FFTs of each planar "slice" for each fixed n1, and then perform the one-dimensional FFTs along the n1 direction. More generally, an asymptotically optimal cache-oblivious algorithm consists of recursively dividing the dimensions into two groups (n_1, ldots, n_{d/2}) and (n_{d/2+1}, ldots, n_d) that are transformed recursively (rounding if d is not even) (see Frigo and Johnson, 2005). Still, this remains a straightforward variation of the row-column algorithm that ultimately requires only a one-dimensional FFT algorithm as the base case, and still has O(N log N) complexity. Yet another variation is to perform matrix transpositions in between transforming subsequent dimensions, so that the transforms operate on contiguous data; this is especially important for out-of-core and distributed memory situations where accessing non-contiguous data is extremely time-consuming.There are other multidimensional FFT algorithms that are distinct from the row-column algorithm, although all of them have O(N log N) complexity. Perhaps the simplest non-row-column FFT is the vector-radix FFT algorithm, which is a generalization of the ordinary Cooleyâ€“Tukey algorithm where one divides the transform dimensions by a vector mathbf{r}=(r_1, r_2, ldots, r_d) of radices at each step. (This may also have cache benefits.) The simplest case of vector-radix is where all of the radices are equal (e.g. vector-radix-2 divides all of the dimensions by two), but this is not necessary. Vector radix with only a single non-unit radix at a time, i.e. mathbf{r}=(1, ldots, 1, r, 1, ldots, 1), is essentially a row-column algorithm. Other, more complicated, methods include polynomial transform algorithms due to Nussbaumer (1977), which view the transform in terms of convolutions and polynomial products. See Duhamel and Vetterli (1990) for more information and references.

## Other generalizations

An O(N5/2log N) generalization to spherical harmonics on the sphere S2 with N2 nodes was described by Mohlenkamp, along with an algorithm conjectured (but not proven) to have O(N2 log2(N)) complexity; Mohlenkamp also provides an implementation in the libftsh library. A spherical-harmonic algorithm with O(N2log N) complexity is described by Rokhlin and Tygert.The fast folding algorithm is analogous to the FFT, except that it operates on a series of binned waveforms rather than a series of real or complex scalar values. Rotation (which in the FFT is multiplication by a complex phasor) is a circular shift of the component waveform.Various groups have also published "FFT" algorithms for non-equispaced data, as reviewed in Potts et al. (2001). Such algorithms do not strictly compute the DFT (which is only defined for equispaced data), but rather some approximation thereof (a non-uniform discrete Fourier transform, or NDFT, which itself is often computed only approximately). More generally there are various other methods of spectral estimation.

## Applications

FFT's importance derives from the fact that in signal processing and image processing it has made working in frequency domain equally computationally feasible as working in temporal or spatial domain. Some of the important applications of FFT includes,

## Research areas

• Big FFTs: With the explosion of big data in fields such as astronomy, the need for 512k FFTs has arisen for certain interferometry calculations. The data collected by projects such as WMAP and LIGO require FFTs of tens of billions of points. As this size does not fit into main memory, so called out-of-core FFTs are an active area of research.
• Approximate FFTs: For applications such as MRI, it is necessary to compute DFTs for nonuniformly spaced grid points and/or frequencies. Multipole based approaches can compute approximate quantities with factor of runtime increase.
• Group FFTs: The FFT may also be explained and interpreted using group representation theory that allows for further generalization. A function on any compact group, including non cyclic, has an expansion in terms of a basis of irreducible matrix elements. It remains active area of research to find efficient algorithm for performing this change of basis. Applications including efficient spherical harmonic expansion, analyzing certain Markov processes, robotics etc.
• Quantum FFTs: Shor's fast algorithm for integer factorization on a quantum computer has a subroutine to compute DFT of a binary vector. This is implemented as sequence of 1- or 2-bit quantum gates now known as quantum FFT, which is effectively the Cooleyâ€“Tukey FFT realized as a particular factorization of the Fourier matrix. Extension to these ideas is currently being explored.

## Language reference{| class"wikitable"

!Language!Command/Method!Pre-requisites
R (programming language)>R|stats::fft(x)|None
Octave programming language>Octave/MATLAB|fft(x)|None
Python (programming language)>Python|fft.fft(x)|numpy
Wolfram Mathematica>Mathematica|Fourier[x]|None
Julia (programming language)>Julia|fft(A [,dims])|FFTW

FFT-related algorithms: FFT implementations:
• ALGLIB â€“ C++ and C library with real/complex FFT implementation.
• FFTW "Fastest Fourier Transform in the West" â€“ C library for the discrete Fourier transform (DFT) in one or more dimensions.
• FFTS â€“ The Fastest Fourier Transform in the South.
• FFTPACK â€“ another Fortran FFT library (public domain)
• Math Kernel Library

## References

• DOCUMENT, E. Oran, Brigham, The Fast Fourier Transform, New York, USA, Prentice-Hall, 2002,
• BOOK, Thomas H., Cormen, Thomas H. Cormen, Charles E., Leiserson, Charles E. Leiserson, Ronald L., Rivest, Ronald L. Rivest, Clifford, Stein, Clifford Stein, 2001, Introduction to Algorithms, Introduction to Algorithms, 2, MIT Press / McGraw-Hill, 0-262-03293-7, {{ISBN, 978-0-262-03293-3, |chapter=Chapter 30: Polynomials and the FFT}}
• BOOK, Douglas F., Elliott, K. Ramamohan, Rao, 1982, Fast transforms: Algorithms, analyses, applications, New York, USA, Academic Press,
• BOOK, Haitao, Guo, Gary A., Sitton, Charles Sidney, Burrus, Charles Sidney Burrus, 1994, 10.1109/ICASSP.1994.389994, The Quick Discrete Fourier Transform, Proceedings on the IEEE Conference on Acoustics, Speech, and Signal Processing (ICASSP), 3, 445â€“448, 978-0-7803-1775-8,
• JOURNAL, Johnson, Steven G., Frigo, Matteo, 2007, A modified split-radix FFT with fewer arithmetic operations,weblink IEEE Transactions on Signal Processing, 55, 1, 111â€“119, 10.1109/tsp.2006.882087, 10.1.1.582.5497,
• BOOK, Press, William H., Teukolsky, Saul A., Vetterling, William T., Flannery, Brian P., 2007, Numerical Recipes: The Art of Scientific Computing, 3, Cambridge University Press, New York, USA, 978-0-521-88068-8, Chapter 12. Fast Fourier Transform,weblink
• BOOK, Richard Collom, Singleton, A Short Bibliography on the Fast Fourier Transform, Special Issue on Fast Fourier Transform, IEEE Transactions on Audio and Electroacoustics, IEEE Audio and Electroacoustics Group, AU-17, 2, June 1969, 166â€“169,weblink 2017-10-31, no, (NB. Contains extensive bibliography.)

- content above as imported from Wikipedia
- "fast Fourier transform" does not exist on GetWiki (yet)
- time: 3:23pm EDT - Wed, Mar 20 2019
[ this remote article is provided by Wikipedia ]
LATEST EDITS [ see all ]
GETWIKI 09 MAY 2016
GETWIKI 18 OCT 2015
M.R.M. Parrott
Biographies
GETWIKI 20 AUG 2014
GETWIKI 19 AUG 2014
GETWIKI 18 AUG 2014
Wikinfo
Culture