Rader's algorithm (1968), named for Charles M. Rader of
MIT Lincoln Laboratory
The MIT Lincoln Laboratory, located in Lexington, Massachusetts, is a United States Department of Defense federally funded research and development center chartered to apply advanced technology to problems of national security. Research and d ...
, is a
fast Fourier transform
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 t ...
(FFT) algorithm 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
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 way ...
sizes by re-expressing the DFT as a cyclic
convolution
In mathematics (in particular, functional analysis), convolution is a mathematical operation on two functions ( and ) that produces a third function (f*g) that expresses how the shape of one is modified by the other. The term ''convolution' ...
(the other algorithm for FFTs of prime sizes,
Bluestein's algorithm, also works by rewriting the DFT as a convolution).
Since Rader's algorithm only depends upon the periodicity of the DFT kernel, it is directly applicable to any other transform (of prime order) with a similar property, such as a
number-theoretic transform
In mathematics, the discrete Fourier transform over a ring generalizes the discrete Fourier transform (DFT), of a function whose values are commonly complex numbers, over an arbitrary ring.
Definition
Let R be any ring, let n\geq 1 be an integer ...
or the
discrete Hartley transform
A discrete Hartley transform (DHT) is a Fourier-related transform of discrete, periodic data similar to the discrete Fourier transform (DFT), with analogous applications in signal processing and related fields. Its main distinction from the DFT is ...
.
The algorithm can be modified to gain a factor of two savings for the case of DFTs of real data, using a slightly modified re-indexing/permutation to obtain two half-size cyclic convolutions of real data; an alternative adaptation for DFTs of real data uses the
discrete Hartley transform
A discrete Hartley transform (DHT) is a Fourier-related transform of discrete, periodic data similar to the discrete Fourier transform (DFT), with analogous applications in signal processing and related fields. Its main distinction from the DFT is ...
.
[Matteo Frigo and ]Steven G. Johnson
Steven Glenn Johnson (born 1973) is an American mathematician known for being a co-creator of the FFTW library for software-based fast Fourier transforms and for his work on photonic crystals. He is professor of Applied Mathematics and Physics at ...
,
The Design and Implementation of FFTW3
" ''Proceedings of the IEEE'' 93 (2), 216–231 (2005).
Winograd extended Rader's algorithm to include prime-power DFT sizes
, and today Rader's algorithm is sometimes described as a special case of
Winograd's FFT algorithm, also called the ''multiplicative Fourier transform algorithm'' (Tolimieri et al., 1997), which applies to an even larger class of sizes. However, for
composite sizes such as prime powers, the
Cooley–Tukey FFT algorithm
The Cooley–Tukey algorithm, named after J. W. Cooley and John Tukey, is the most common fast Fourier transform (FFT) algorithm. It re-expresses the discrete Fourier transform (DFT) of an arbitrary composite size N = N_1N_2 in terms of ''N''1 ...
is much simpler and more practical to implement, so Rader's algorithm is typically only used for large-prime
base cases of Cooley–Tukey's
recursive
Recursion (adjective: ''recursive'') occurs when a thing is defined in terms of itself or of its type. Recursion is used in a variety of disciplines ranging from linguistics to logic. The most common application of recursion is in mathemati ...
decomposition of the DFT.
[
]
Algorithm
Begin with the definition of the discrete Fourier transform:
:
If ''N'' is a prime number, then the set of non-zero indices forms a group
A group is a number of persons or things that are located, gathered, or classed together.
Groups of people
* Cultural group, a group whose members share the same cultural identity
* Ethnic group, a group whose members share the same ethnic ide ...
under multiplication modulo
In computing, the modulo operation returns the remainder or signed remainder of a division, after one number is divided by another (called the '' modulus'' of the operation).
Given two positive numbers and , modulo (often abbreviated as ) is t ...
''N''. One consequence of the number theory
Number theory (or arithmetic or higher arithmetic in older usage) is a branch of pure mathematics devoted primarily to the study of the integers and integer-valued functions. German mathematician Carl Friedrich Gauss (1777–1855) said, "Math ...
of such groups is that there exists a generator of the group (sometimes called a primitive root, which can be found by exhaustive search or slightly better algorithms[Donald E. Knuth, ''The Art of Computer Programming, vol. 2: Seminumerical Algorithms'', 3rd edition, section 4.5.4, p. 391 (Addison–Wesley, 1998).]). This generator is an integer ''g'' such that for any non-zero index ''n'' and for a unique (forming a bijection from ''q'' to non-zero ''n''). Similarly, for any non-zero index ''k'' and for a unique , where the negative exponent denotes the multiplicative inverse
In mathematics, a multiplicative inverse or reciprocal for a number ''x'', denoted by 1/''x'' or ''x''−1, is a number which when multiplied by ''x'' yields the multiplicative identity, 1. The multiplicative inverse of a fraction ''a''/''b ...
of . That means that we can rewrite the DFT using these new indices ''p'' and ''q'' as:
:
:
(Recall that ''x''''n'' and ''X''''k'' are implicitly periodic in ''N'', and also that (Euler's identity
In mathematics, Euler's identity (also known as Euler's equation) is the equality
e^ + 1 = 0
where
: is Euler's number, the base of natural logarithms,
: is the imaginary unit, which by definition satisfies , and
: is pi, the ratio of the circ ...
). Thus, all indices and exponents are taken modulo ''N'' as required by the group arithmetic.)
The final summation, above, is precisely a cyclic convolution of the two sequences ''a''''q'' and ''b''''q'' (of length ''N''–1, because ) defined by:
:
:
Evaluating the convolution
Since ''N''–1 is composite, this convolution can be performed directly via the convolution theorem
In mathematics, the convolution theorem states that under suitable conditions the Fourier transform of a convolution of two functions (or signals) is the pointwise product of their Fourier transforms. More generally, convolution in one domain (e. ...
and more conventional FFT algorithms. However, that may not be efficient if ''N''–1 itself has large prime factors, requiring recursive use of Rader's algorithm. Instead, one can compute a length-(''N''–1) cyclic convolution exactly by zero-padding it to a length of at least 2(''N''–1)–1, say 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 two as the base and integer as the exponent.
In a context where only integers are considered, is restricted to non-negati ...
, which can then be evaluated in O(''N'' log ''N'') time without the recursive application of Rader's algorithm.
This algorithm, then, requires O(''N'') additions plus O(''N'' log ''N'') time for the convolution. In practice, the O(''N'') additions can often be performed by absorbing the additions into the convolution: if the convolution is performed by a pair of FFTs, then the sum of ''x''''n'' is given by the DC (0th) output of the FFT of ''a''''q'' plus ''x''0, and ''x''0 can be added to all the outputs by adding it to the DC term of the convolution prior to the inverse FFT. Still, this algorithm requires intrinsically more operations than FFTs of nearby composite sizes, and typically takes 3–10 times as long in practice.
If Rader's algorithm is performed by using FFTs of size ''N''–1 to compute the convolution, rather than by zero padding as mentioned above, the efficiency depends strongly upon ''N'' and the number of times that Rader's algorithm must be applied recursively. The worst case would be if ''N''–1 were 2''N''2 where ''N''2 is prime, with ''N''2–1 = 2''N''3 where ''N''3 is prime, and so on. In such cases, supposing that the chain of primes extended all the way down to some bounded value, the recursive application of Rader's algorithm would actually require O(''N''2) time{{Dubious, Time complexity without zero-padding, date=January 2021. Such ''N''j are called Sophie Germain prime
In number theory, a prime number ''p'' is a if 2''p'' + 1 is also prime. The number 2''p'' + 1 associated with a Sophie Germain prime is called a . For example, 11 is a Sophie Germain prime and 2 × 11 +  ...
s, and such a sequence of them is called a Cunningham chain
In mathematics, a Cunningham chain is a certain sequence of prime numbers. Cunningham chains are named after mathematician A. J. C. Cunningham. They are also called chains of nearly doubled primes.
Definition
A Cunningham chain of the first ki ...
of the first kind. The lengths of Cunningham chains, however, are observed to grow more slowly than log2(''N''), so Rader's algorithm applied in this way is probably not O(''N''2), though it is possibly worse than O(''N'' log ''N'') for the worst cases. Fortunately, a guarantee of O(''N'' log ''N'') complexity can be achieved by zero padding.
References
FFT algorithms