HOME

TheInfoList



OR:

A fast Fourier transform (FFT) is an
algorithm In mathematics and computer science, an algorithm () is a finite sequence of Rigour#Mathematics, mathematically rigorous instructions, typically used to solve a class of specific Computational problem, problems or to perform a computation. Algo ...
that computes the
discrete Fourier transform In mathematics, the discrete Fourier transform (DFT) converts a finite sequence of equally-spaced Sampling (signal processing), samples of a function (mathematics), function into a same-length sequence of equally-spaced samples of the discre ...
(DFT) of a sequence, or its inverse (IDFT). A
Fourier transform In mathematics, the Fourier transform (FT) is an integral transform that takes a function as input then outputs another function that describes the extent to which various frequencies are present in the original function. The output of the tr ...
converts a signal from its original domain (often time or space) to a representation in the
frequency domain In mathematics, physics, electronics, control systems engineering, and statistics, the frequency domain refers to the analysis of mathematical functions or signals with respect to frequency (and possibly phase), rather than time, as in time ser ...
and vice versa. The DFT is obtained by decomposing a
sequence In mathematics, a sequence is an enumerated collection of objects in which repetitions are allowed and order matters. Like a set, it contains members (also called ''elements'', or ''terms''). The number of elements (possibly infinite) is cal ...
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 In applied mathematics, a DFT matrix is a ''square matrix'' as an expression of a discrete Fourier transform (DFT) as a transformation matrix, which can be applied to a signal through matrix multiplication. Definition An ''N''-point DFT is expres ...
into a product of sparse (mostly zero) factors. As a result, it manages to reduce the
complexity Complexity characterizes the behavior of a system or model whose components interact in multiple ways and follow local rules, leading to non-linearity, randomness, collective dynamics, hierarchy, and emergence. The term is generally used to c ...
of computing the DFT from O(n^2), which arises if one simply applies the definition of DFT, to O(n \log n), where is the data size. The difference in speed can be enormous, especially for long data sets where may be in the thousands or millions. As the FFT is merely an algebraic refactoring of terms within the DFT, then the DFT and the FFT both perform mathematically equivalent and interchangeable operations, assuming that all terms are computed with infinite precision. However, in the presence of
round-off error In computing, a roundoff error, also called rounding error, is the difference between the result produced by a given algorithm using exact arithmetic and the result produced by the same algorithm using finite-precision, rounded arithmetic. Roun ...
, many FFT algorithms are much more accurate than evaluating the DFT definition directly or indirectly. Fast Fourier transforms are widely used for
applications Application may refer to: Mathematics and computing * Application software, computer software designed to help the user to perform specific tasks ** Application layer, an abstraction layer that specifies protocols and interface methods used in a ...
in engineering, music, science, and mathematics. The basic ideas were popularized in 1965, but some algorithms had been derived as early as 1805. In 1994,
Gilbert Strang William Gilbert Strang (born November 27, 1934) is an American mathematician known for his contributions to Finite elements, finite element theory, the calculus of variations, wavelet analysis and linear algebra. He has made many contributions ...
described the FFT as "the most important
numerical algorithm Numerical analysis is the study of algorithms that use numerical approximation (as opposed to symbolic manipulations) for the problems of mathematical analysis (as distinguished from discrete mathematics). It is the study of numerical methods t ...
of our lifetime", and it was included in Top 10 Algorithms of 20th Century by the
IEEE The Institute of Electrical and Electronics Engineers (IEEE) is an American 501(c)(3) organization, 501(c)(3) public charity professional organization for electrical engineering, electronics engineering, and other related disciplines. The IEEE ...
magazine ''Computing in Science & Engineering''. There are many different FFT algorithms based on a wide range of published theories, from simple complex-number arithmetic to
group theory In abstract algebra, group theory studies the algebraic structures known as group (mathematics), groups. The concept of a group is central to abstract algebra: other well-known algebraic structures, such as ring (mathematics), rings, field ( ...
and
number theory Number theory is a branch of pure mathematics devoted primarily to the study of the integers and arithmetic functions. Number theorists study prime numbers as well as the properties of mathematical objects constructed from integers (for example ...
. The best-known FFT algorithms depend upon the
factorization In mathematics, factorization (or factorisation, see American and British English spelling differences#-ise, -ize (-isation, -ization), English spelling differences) or factoring consists of writing a number or another mathematical object as a p ...
of , but there are FFTs with O(n \log n) complexity for all, even
prime A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways ...
, . Many FFT algorithms depend only on the fact that e^ is an 'th primitive root of unity, and thus can be applied to analogous transforms over any
finite field In mathematics, a finite field or Galois field (so-named in honor of Évariste Galois) is a field (mathematics), field that contains a finite number of Element (mathematics), elements. As with any field, a finite field is a Set (mathematics), s ...
, 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 factor, any FFT algorithm can easily be adapted for it.


History

The development of fast algorithms for DFT was prefigured in
Carl Friedrich Gauss Johann Carl Friedrich Gauss (; ; ; 30 April 177723 February 1855) was a German mathematician, astronomer, geodesist, and physicist, who contributed to many fields in mathematics and science. He was director of the Göttingen Observatory and ...
's unpublished 1805 work on the orbits of asteroids Pallas and Juno. Gauss wanted to interpolate the orbits from sample observations; his method was very similar to the one that would be published in 1965 by James Cooley and
John Tukey John Wilder Tukey (; June 16, 1915 – July 26, 2000) was an American mathematician and statistician, best known for the development of the fast Fourier Transform (FFT) algorithm and box plot. The Tukey range test, the Tukey lambda distributi ...
, who are generally credited for the invention of the modern generic FFT algorithm. While Gauss's work predated even
Joseph Fourier Jean-Baptiste Joseph Fourier (; ; 21 March 1768 – 16 May 1830) was a French mathematician and physicist born in Auxerre, Burgundy and best known for initiating the investigation of Fourier series, which eventually developed into Fourier analys ...
's 1822 results, he did not analyze the method's
complexity Complexity characterizes the behavior of a system or model whose components interact in multiple ways and follow local rules, leading to non-linearity, randomness, collective dynamics, hierarchy, and emergence. The term is generally used to c ...
, and eventually used other methods to achieve the same end. 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 X-ray crystallography is the experimental science of determining the atomic and molecular structure of a crystal, in which the crystalline structure causes a beam of incident X-rays to Diffraction, diffract in specific directions. By measuring th ...
, 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 "double [] with only slightly more than double the labor", though like Gauss they did not do the analysis to discover that this led to O(n \log n) scaling. In 1958, I. J. Good published a paper establishing the prime-factor FFT algorithm that applies to discrete Fourier transforms of size n=n_1 n_2, where n_1 and n_2 are coprime. James Cooley and John Tukey independently rediscovered these earlier algorithms and published a more general FFT in 1965 that is applicable when is composite and not necessarily a power of 2, as well as analyzing the O(n \log n) scaling. 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, an FFT 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 Digital signal processing (DSP) is the use of digital processing, such as by computers or more specialized digital signal processors, to perform a wide variety of signal processing operations. The digital signals processed in this manner are a ...
.


Definition

Let x_0, \ldots, x_ be
complex number In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted , called the imaginary unit and satisfying the equation i^= -1; every complex number can be expressed in the for ...
s. The DFT is defined by the formula : X_k = \sum_^ x_m e^ \qquad k = 0,\ldots,n-1, where e^ is a primitive 'th root of 1. Evaluating this definition directly requires O(n^2) operations: there are outputs , and each output requires a sum of terms. An FFT is any method to compute the same results in O(n \log n) operations. All known FFT algorithms require O(n \log n) operations, although there is no known proof that lower complexity 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 n^2 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. In contrast, the radix-2 Cooley–Tukey algorithm, for a power of 2, can compute the same result with only (n/2)\log_2(n) complex multiplications (again, ignoring simplifications of multiplications by 1 and similar) and n\log_2(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 (for example, see Frigo &
Johnson Johnson may refer to: People and fictional characters *Johnson (surname), a common surname in English * Johnson (given name), a list of people * List of people with surname Johnson, including fictional characters *Johnson (composer) (1953–2011) ...
, 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 In computer science, divide and conquer is an algorithm design paradigm. A divide-and-conquer algorithm recursively breaks down a problem into two or more sub-problems of the same or related type, until these become simple enough to be solved dir ...
that recursively breaks down a DFT of any composite size n = n_1n_2 into n_1 smaller DFTs of size n_2, along with O(n) multiplications by complex
roots of unity In mathematics, a root of unity is any complex number that yields 1 when raised to some positive integer power . Roots of unity are used in many branches of mathematics, and are especially important in number theory, the theory of group char ...
traditionally called
twiddle factor A twiddle factor, in fast Fourier transform (FFT) algorithms, is any of the trigonometric constant coefficients that are multiplied by the data in the course of the algorithm. This term was apparently coined by Gentleman & Sande in 1966, and has ...
s (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 together independently re-invented an algorithm known to
Carl Friedrich Gauss Johann Carl Friedrich Gauss (; ; ; 30 April 177723 February 1855) was a German mathematician, astronomer, geodesist, and physicist, who contributed to many fields in mathematics and science. He was director of the Göttingen Observatory and ...
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 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

For n = n_1n_2 with
coprime In number theory, two integers and are coprime, relatively prime or mutually prime if the only positive integer that is a divisor of both of them is 1. Consequently, any prime number that divides does not divide , and vice versa. This is equiv ...
n_1 and n_2, one can use the prime-factor (Good–Thomas) algorithm (PFA), based on the
Chinese remainder theorem In mathematics, the Chinese remainder theorem states that if one knows the remainders of the Euclidean division of an integer ''n'' by several integers, then one can determine uniquely the remainder of the division of ''n'' by the product of thes ...
, to factorize the DFT similarly to Cooley–Tukey but without the twiddle factors. The Rader–Brenner algorithm (1976) is a Cooley–Tukey-like factorization but with purely imaginary twiddle factors, reducing multiplications at the cost of increased additions and reduced
numerical stability In the mathematical subfield of numerical analysis, numerical stability is a generally desirable property of numerical algorithms. The precise definition of stability depends on the context: one important context is numerical linear algebra, and ...
; it was later superseded by the split-radix variant of Cooley–Tukey (which achieves the same multiplication count but with fewer additions and without sacrificing accuracy). Algorithms that recursively factorize the DFT into smaller operations other than DFTs include the Bruun and QFT algorithms. (The Rader–Brenner and QFT algorithms were proposed for power-of-two sizes, but it is possible that they could be adapted to general composite . Bruun's algorithm applies to arbitrary even composite sizes.) Bruun's algorithm, in particular, is based on interpreting the FFT as a recursive factorization of the
polynomial In mathematics, a polynomial is a Expression (mathematics), mathematical expression consisting of indeterminate (variable), indeterminates (also called variable (mathematics), variables) and coefficients, that involves only the operations of addit ...
z^n-1, here into real-coefficient polynomials of the form z^m-1 and z^ + az^m + 1. Another polynomial viewpoint is exploited by the Winograd FFT algorithm, which factorizes z^n-1 into
cyclotomic polynomial In mathematics, the ''n''th cyclotomic polynomial, for any positive integer ''n'', is the unique irreducible polynomial with integer coefficients that is a divisor of x^n-1 and is not a divisor of x^k-1 for any Its roots are all ''n''th prim ...
s—these often have coefficients of 1, 0, or −1, and therefore require few (if any) multiplications, so Winograd can be used to obtain minimal-multiplication FFTs and is often used to find efficient algorithms for small factors. Indeed, Winograd showed that the DFT can be computed with only O(n) irrational multiplications, leading to a proven achievable lower bound on the number of multiplications for power-of-two sizes; this comes at the cost of many more additions, a tradeoff no longer favorable on modern processors with hardware multipliers. In particular, Winograd also makes use of the PFA as well as an algorithm by Rader for FFTs of ''prime'' sizes. Rader's algorithm, exploiting the existence of a generator for the multiplicative group modulo prime , expresses a DFT of prime size as a cyclic
convolution In mathematics (in particular, functional analysis), convolution is a operation (mathematics), mathematical operation on two function (mathematics), functions f and g that produces a third function f*g, as the integral of the product of the two ...
of (composite) size , which can then be computed by a pair of ordinary FFTs via the convolution theorem (although Winograd uses other convolution methods). Another prime-size FFT is due to L. I. Bluestein, and is sometimes called the chirp-z algorithm; it also re-expresses a DFT as a convolution, but this time of the ''same'' size (which can be zero-padded to a
power of two A power of two is a number of the form where is an integer, that is, the result of exponentiation with number 2, two as the Base (exponentiation), base and integer  as the exponent. In the fast-growing hierarchy, is exactly equal to f_1^ ...
and evaluated by radix-2 Cooley–Tukey FFTs, for example), via the identity : nk = -\frac 2 + \frac 2 + \frac 2. Hexagonal fast Fourier transform (HFFT) 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 or symmetric data

In many applications, the input data for the DFT are purely real, in which case the outputs satisfy the symmetry :X_ = 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 Discrete may refer to: *Discrete particle or quantum in physics, for example in quantum theory *Discrete device, an electronic component with just one circuit element, either passive or active, other than an integrated circuit *Discrete group, a g ...
/ 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- and post-processing.


Computational issues


Bounds on complexity and operation counts

A fundamental question of longstanding theoretical interest is to prove lower bounds on the
complexity Complexity characterizes the behavior of a system or model whose components interact in multiple ways and follow local rules, leading to non-linearity, randomness, collective dynamics, hierarchy, and emergence. The term is generally used to c ...
and exact operation counts of fast Fourier transforms, and many open problems remain. It is not rigorously proved whether DFTs truly require \Omega(n \log n) (i.e., order ''n \log n'' or greater) operations, even for the simple case of
power of two A power of two is a number of the form where is an integer, that is, the result of exponentiation with number 2, two as the Base (exponentiation), base and integer  as the exponent. In the fast-growing hierarchy, is exactly equal to f_1^ ...
sizes, although no algorithms with lower complexity are known. In particular, the count of arithmetic operations is usually the focus of such questions, although actual performance on modern-day computers is determined by many other factors such as cache or CPU pipeline optimization. Following work by Shmuel Winograd (1978), a tight \Theta(n) lower bound is known for the number of real multiplications required by an FFT. It can be shown that only 4n - 2\log_2^2(n) - 2\log_2(n) - 4 irrational real multiplications are required to compute a DFT of power-of-two length n = 2^m. Moreover, explicit algorithms that achieve this count are known (Heideman & Burrus, 1986; Duhamel, 1990). However, these algorithms require too many additions to be practical, at least on modern computers with hardware multipliers (Duhamel, 1990; Frigo &
Johnson Johnson may refer to: People and fictional characters *Johnson (surname), a common surname in English * Johnson (given name), a list of people * List of people with surname Johnson, including fictional characters *Johnson (composer) (1953–2011) ...
, 2005). A tight lower bound is not known on the number of required additions, although lower bounds have been proved under some restrictive assumptions on the algorithms. In 1973, Morgenstern proved an \Omega(n \log n) lower bound on the addition count for algorithms where the multiplicative constants have bounded magnitudes (which is true for most but not all FFT algorithms). Pan (1986) proved an \Omega(n \log n) lower bound assuming a bound on a measure of the FFT algorithm's ''asynchronicity'', but the generality of this assumption is unclear. For the case of power-of-two , Papadimitriou (1979) argued that the number n \log_2 n of complex-number additions achieved by Cooley–Tukey algorithms is ''optimal'' under certain assumptions on the
graph Graph may refer to: Mathematics *Graph (discrete mathematics), a structure made of vertices and edges **Graph theory, the study of such graphs and their properties *Graph (topology), a topological space resembling a graph in the sense of discret ...
of the algorithm (his assumptions imply, among other things, that no additive identities in the roots of unity are exploited). (This argument would imply that at least 2N \log_2 N real additions are required, although this is not a tight bound because extra additions are required as part of complex-number multiplications.) Thus far, no published FFT algorithm has achieved fewer than n \log_2 n complex-number additions (or their equivalent) for power-of-two . A third problem is to minimize the ''total'' number of real multiplications and additions, sometimes called the ''arithmetic complexity'' (although in this context it is the exact count and not the asymptotic complexity that is being considered). Again, no tight lower bound has been proven. Since 1968, however, the lowest published count for power-of-two was long achieved by the split-radix FFT algorithm, which requires 4n\log_2(n) - 6n + 8 real multiplications and additions for . This was recently reduced to \sim \frac n \log_2 n (Johnson and Frigo, 2007; Lundy and Van Buskirk, 2007). A slightly larger count (but still better than split radix for ) was shown to be provably optimal for under additional restrictions on the possible algorithms (split-radix-like flowgraphs with unit-modulus multiplicative factors), by reduction to a satisfiability modulo theories problem solvable by brute force (Haynal & Haynal, 2011). Most of the attempts to lower or prove the complexity of FFT algorithms have focused on the ordinary complex-data case, because it is the simplest. However, complex-data FFTs are so closely related to algorithms for related problems such as real-data FFTs,
discrete cosine transform A discrete cosine transform (DCT) expresses a finite sequence of data points in terms of a sum of cosine functions oscillating at different frequency, frequencies. The DCT, first proposed by Nasir Ahmed (engineer), Nasir Ahmed in 1972, is a widely ...
s, discrete Hartley transforms, and so on, that any improvement in one of these would immediately lead to improvements in the others (Duhamel & Vetterli, 1990).


Approximations

All of the FFT algorithms discussed above compute the DFT exactly (i.e. neglecting
floating-point In computing, floating-point arithmetic (FP) is arithmetic on subsets of real numbers formed by a ''significand'' (a Sign (mathematics), signed sequence of a fixed number of digits in some Radix, base) multiplied by an integer power of that ba ...
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 Parallel computing is a type of computing, computation in which many calculations or Process (computing), processes are carried out simultaneously. Large problems can often be divided into smaller ones, which can then be solved at the same time. ...
with the help of a fast multipole method. A
wavelet A wavelet is a wave-like oscillation with an amplitude that begins at zero, increases or decreases, and then returns to zero one or more times. Wavelets are termed a "brief oscillation". A taxonomy of wavelets has been established, based on the n ...
-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 out of 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 in a large- example () using a probabilistic approximate algorithm (which estimates the largest coefficients to several decimal places).


Accuracy

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(\varepsilon \log n), compared to O(\varepsilon n^) for the naïve DFT formula, where is the machine floating-point relative precision. In fact, the
root mean square In mathematics, the root mean square (abbrev. RMS, or rms) of a set of values is the square root of the set's mean square. Given a set x_i, its RMS is denoted as either x_\mathrm or \mathrm_x. The RMS is also known as the quadratic mean (denote ...
(rms) errors are much better than these upper bounds, being only O(\varepsilon \sqrt) for Cooley–Tukey and O(\varepsilon \sqrt) 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 In mathematics, the trigonometric functions (also called circular functions, angle functions or goniometric functions) are real functions which relate an angle of a right-angled triangle to ratios of two side lengths. They are widely used in all ...
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 In computing, fixed-point is a method of representing fractional (non-integer) numbers by storing a fixed number of digits of their fractional part. Dollar amounts, for example, are often stored with exactly two fractional digits, represen ...
, the finite-precision errors accumulated by FFT algorithms are worse, with rms errors growing as O(\sqrt) for the Cooley–Tukey algorithm (Welch, 1969). 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). The values for intermediate frequencies may be obtained by various averaging methods.


Multidimensional FFTs

As defined in the multidimensional DFT article, the multidimensional DFT :X_\mathbf = \sum_^ e^ x_\mathbf transforms an array with a -dimensional
vector Vector most often refers to: * Euclidean vector, a quantity with a magnitude and a direction * Disease vector, an agent that carries and transmits an infectious pathogen into another living organism Vector may also refer to: Mathematics a ...
of indices \mathbf = \left(n_1, \ldots, n_d\right) by a set of nested summations (over n_j = 0 \ldots N_j - 1 for each ), where the division \mathbf / \mathbf = \left(n_1/N_1, \ldots, n_d/N_d\right) 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 one-dimensional FFTs (by any of the above algorithms): first you transform along the dimension, then along the dimension, and so on (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 \cdots n_d is the total number of data points transformed. In particular, there are transforms of size , etc., so the complexity of the sequence of FFTs is: :\begin & \frac O(n_1 \log n_1) + \cdots + \frac O(n_d \log n_d) \\ pt = & O\left(n \left log n_1 + \cdots + \log n_d\rightright) = O(n \log n). \end In two dimensions, the ''x''k can be viewed as an n_1 \times n_2
matrix Matrix (: matrices or matrixes) or MATRIX may refer to: Science and mathematics * Matrix (mathematics), a rectangular array of numbers, symbols or expressions * Matrix (logic), part of a formula in prenex normal form * Matrix (biology), the m ...
, 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 ''n''1, and then perform the one-dimensional FFTs along the ''n''1 direction. More generally, an asymptotically optimal
cache-oblivious algorithm In computing, a cache-oblivious algorithm (or cache-transcendent algorithm) is an algorithm designed to take advantage of a processor cache without having the size of the cache (or the length of the cache lines, etc.) as an explicit parameter. An ...
consists of recursively dividing the dimensions into two groups (n_1, \ldots, n_) and (n_, \ldots, n_d) that are transformed recursively (rounding if 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 In computing, external memory algorithms or out-of-core algorithms are algorithms that are designed to process data that are too large to fit into a computer's main memory at once. Such algorithms must be optimized to efficiently fetch and access d ...
and
distributed memory In computer science, distributed memory refers to a Multiprocessing, multiprocessor computer system in which each Central processing unit, processor has its own private Computer memory, memory. Computational tasks can only operate on local data ...
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 = \left(r_1, r_2, \ldots, r_d\right) 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 = \left(1, \ldots, 1, r, 1, \ldots, 1\right), 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(n^ \log n) generalization to
spherical harmonics In mathematics and physical science, spherical harmonics are special functions defined on the surface of a sphere. They are often employed in solving partial differential equations in many scientific fields. The table of spherical harmonics co ...
on the sphere with nodes was described by Mohlenkamp, along with an algorithm conjectured (but not proven) to have O(n^2 \log^2(n)) complexity; Mohlenkamp also provides an implementation in the libftsh library. A spherical-harmonic algorithm with O(n^2 \log 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

The FFT is used in digital recording, sampling,
additive synthesis Additive synthesis is a sound synthesis technique that creates timbre by adding sine waves together. The timbre of musical instruments can be considered in the light of Fourier series, Fourier theory to consist of multiple harmonic or inharmoni ...
and pitch correction software. The FFT's importance derives from the fact that it has made working in the frequency domain equally computationally feasible as working in the temporal or spatial domain. Some of the important applications of the FFT include: * fast large-integer multiplication algorithms and polynomial multiplication, * efficient matrix–vector multiplication for Toeplitz, circulant and other structured matrices, * filtering algorithms (see overlap–add and overlap–save methods), * fast algorithms for
discrete cosine Discrete may refer to: *Discrete particle or quantum in physics, for example in quantum theory *Discrete device, an electronic component with just one circuit element, either passive or active, other than an integrated circuit *Discrete group, a g ...
or sine transforms (e.g. fast DCT used for
JPEG JPEG ( , short for Joint Photographic Experts Group and sometimes retroactively referred to as JPEG 1) is a commonly used method of lossy compression for digital images, particularly for those images produced by digital photography. The degr ...
and
MPEG The Moving Picture Experts Group (MPEG) is an alliance of working groups established jointly by International Organization for Standardization, ISO and International Electrotechnical Commission, IEC that sets standards for media coding, includ ...
/ MP3 encoding and decoding), * fast Chebyshev approximation, * solving
difference equation In mathematics, a recurrence relation is an equation according to which the nth term of a sequence of numbers is equal to some combination of the previous terms. Often, only k previous terms of the sequence appear in the equation, for a parameter ...
s, * computation of isotopic distributions. * modulation and demodulation of complex data symbols using orthogonal frequency-division multiplexing (OFDM) for 5G, LTE, Wi-Fi, DSL, and other modern communication systems. An original application of the FFT in
finance Finance refers to monetary resources and to the study and Academic discipline, discipline of money, currency, assets and Liability (financial accounting), liabilities. As a subject of study, is a field of Business administration, Business Admin ...
particularly in the
Valuation of options In finance, a price (premium) is paid or received for purchasing or selling options. The calculation of this premium will require sophisticated mathematics. Premium components This price can be split into two components: intrinsic value, and ...
was developed by Marcello Minenna.


Alternatives

The FFT can be a poor choice for analyzing signals with non-stationary frequency content—where the frequency characteristics change over time. DFTs provide a global frequency estimate, assuming that all frequency components are present throughout the entire signal, which makes it challenging to detect short-lived or transient features within signals. For cases where frequency information appears briefly in the signal or generally varies over time, alternatives like the short-time Fourier transform, discrete wavelet transforms, or discrete Hilbert transform can be more suitable. These transforms allow for localized frequency analysis by capturing both frequency and time-based information.


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 The Laser Interferometer Gravitational-Wave Observatory (LIGO) is a large-scale physics experiment and observatory designed to detect cosmic gravitational waves and to develop gravitational-wave observations as an astronomical tool. Prior to LIG ...
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 allowing 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 an active area of research to find an efficient algorithm for performing this change of basis. Applications including efficient spherical harmonic expansion, analyzing certain
Markov process In probability theory and statistics, a Markov chain or Markov process is a stochastic process describing a sequence of possible events in which the probability of each event depends only on the state attained in the previous event. Informally, ...
es, robotics etc. ; Quantum FFTs: Shor's fast algorithm for
integer factorization In mathematics, integer factorization is the decomposition of a positive integer into a product of integers. Every positive integer greater than 1 is either the product of two or more integer factors greater than 1, in which case it is a comp ...
on a quantum computer has a subroutine to compute DFT of a binary vector. This is implemented as a 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


See also

FFT-related algorithms: * Bit-reversal permutation * Goertzel algorithm – computes individual terms of discrete Fourier transform FFT implementations: * ALGLIB – a dual/GPL-licensed C++ and C# library (also supporting other languages), with real/complex FFT implementation * FFTPACK – another Fortran FFT library (public domain) * Architecture-specific: ** Arm Performance Libraries ** Intel Integrated Performance Primitives ** Intel Math Kernel Library * Many more implementations are available, for CPUs and GPUs, such as PocketFFT for C++ Other links: * Odlyzko–Schönhage algorithm applies the FFT to finite
Dirichlet series In mathematics, a Dirichlet series is any series of the form \sum_^\infty \frac, where ''s'' is complex, and a_n is a complex sequence. It is a special case of general Dirichlet series. Dirichlet series play a variety of important roles in anal ...
* Schönhage–Strassen algorithm – asymptotically fast multiplication algorithm for large integers * Butterfly diagram – a diagram used to describe FFTs * Spectral music (involves application of DFT analysis to musical composition) * Spectrum analyzer – any of several devices that perform spectrum analysis, often via a DFT *
Time series In mathematics, a time series is a series of data points indexed (or listed or graphed) in time order. Most commonly, a time series is a sequence taken at successive equally spaced points in time. Thus it is a sequence of discrete-time data. ...
* Fast Walsh–Hadamard transform * Generalized distributive law *
Least-squares spectral analysis Least-squares spectral analysis (LSSA) is a method of estimating a Spectral density estimation#Overview, frequency spectrum based on a least-squares fit of Sine wave, sinusoids to data samples, similar to Fourier analysis. Fourier analysis, the ...
* Multidimensional transform * Multidimensional discrete convolution * Fast Fourier Transform Telescope


References


Further reading

* * * * * * * * * * (NB. Contains extensive bibliography.) * * * (Chap.9 and other chapters)


External links


Fast Fourier Transform for Polynomial Multiplication
fast Fourier algorithm
Fast Fourier transform — FFT
FFT programming in C++ the Cooley–Tukey algorithm
Online documentation, links, book, and code
* Sri Welaratna,
Thirty years of FFT analyzers
", ''Sound and Vibration'' (January 1997, 30th anniversary issue) a historical review of hardware FFT devices
ALGLIB FFT Code
a dual/GPL-licensed multilanguage (VBA, C++, Pascal, etc.) numerical analysis and data processing library
SFFT: Sparse Fast Fourier Transform
MIT's sparse (sub-linear time) FFT algorithm, sFFT, and implementation
VB6 FFT
a VB6 optimized library implementation with source code

a visual interactive intro to Fourier transforms and FFT methods
Introduction to Fourier analysis of time series
tutorial how to use of the Fourier transform in time series analysis {{Authority control FFT algorithms Digital signal processing Discrete transforms