Prime-factor FFT algorithm explained

The prime-factor algorithm (PFA), also called the Good–Thomas algorithm (1958/1963), is a fast Fourier transform (FFT) algorithm that re-expresses the discrete Fourier transform (DFT) of a size as a two-dimensional DFT, but only for the case where N1 and N2 are relatively prime. These smaller transforms of size N1 and N2 can then be evaluated by applying PFA recursively or by using some other FFT algorithm.

PFA should not be confused with the mixed-radix generalization of the popular Cooley–Tukey algorithm, which also subdivides a DFT of size into smaller transforms of size N1 and N2. The latter algorithm can use any factors (not necessarily relatively prime), but it has the disadvantage that it also requires extra multiplications by roots of unity called twiddle factors, in addition to the smaller transforms. On the other hand, PFA has the disadvantages that it only works for relatively prime factors (e.g. it is useless for power-of-two sizes) and that it requires more complicated re-indexing of the data based on the additive group isomorphisms. Note, however, that PFA can be combined with mixed-radix Cooley–Tukey, with the former factorizing N into relatively prime components and the latter handling repeated factors.

PFA is also closely related to the nested Winograd FFT algorithm, where the latter performs the decomposed N1 by N2 transform via more sophisticated two-dimensional convolution techniques. Some older papers therefore also call Winograd's algorithm a PFA FFT.

(Although the PFA is distinct from the Cooley–Tukey algorithm, Good's 1958 work on the PFA was cited as inspiration by Cooley and Tukey in their 1965 paper, and there was initially some confusion about whether the two algorithms were different. In fact, it was the only prior FFT work cited by them, as they were not then aware of the earlier research by Gauss and others.)

Algorithm

Let

a(x)

be a polynomial and

\omegan

be a principal

n

-th root of unity
. We define the DFT of

a(x)

as the

n

-tuple

(\hat{a}j)=

j))
(a(\omega
n
.In other words,\hat_j = \sum_^ a_i \omega_n^ \quad \text j = 0, 1, \dots, n - 1.

For simplicity, we denote the transformation as

DFT
\omegan
.

The PFA relies on a coprime factorization of n = \prod_^ n_d and turns

DFT
\omegan
into \bigotimes_d \text_ for some choices of
\omega
nd
's where \bigotimes is the tensor product.

Mapping based on CRT

m\mapsto(m\bmodnd)

from

Zn

to \prod_^ \mathbb_ with (m_d) \mapsto \sum_^ e_d m_d as its inverse where 's are the central orthogonal idempotent elements with \sum_^ e_d = 1 \pmod.Choosing
\omega
nd

=

ed
\omega
n
(therefore,), we rewrite
DFT
\omegan
as follows:

\hat_j = \sum_^ a_i \omega_n^ = \sum_^ a_i \left(\prod_^ \omega_ \right)^ = \sum_^ a_i \prod_^ \omega_^ = \sum_^ \cdots \sum_^ a_ \prod_^ \omega_^ .

Finally, define

a
i0,...,iD

=

a
D-1
\sumided
d=0
and, we have

\hat_ = \sum_^ \cdots \sum_^ a_ \prod_^ \omega_^ .

Therefore, we have the multi-dimensional DFT, .

As algebra isomorphisms

PFA can be stated in a high-level way in terms of algebra isomorphisms.We first recall that for a commutative ring

R

and a group isomorphism from

G

to, we have the following algebra isomorphism

R[G] \cong \bigotimes_d R[G_d],

where

otimes

refers to the tensor product of algebras.

To see how PFA works, we choose

G=(\Zn,+,0)

and

Gd=

(\Z
nd

,+,0)

be additive groups.We also identify

R[G]

as \frac and

R[Gd]

as .Choosing

η=a\mapsto(a\bmodnd)

as the group isomorphism, we have the algebra isomorphism \eta^* : R[G] \cong \bigotimes_d R[G_d], or alternatively,

\eta^* : \frac \cong \bigotimes_d \frac .

Now observe that

DFT
\omegan
is actually an algebra isomorphism from \frac to \prod_i \frac and each
DFT
\omega
nd
is an algebra isomorphism from \frac to \prod_ \frac,we have an algebra isomorphism

η'

from \bigotimes_d \prod_ \frac to \prod_i \frac.What PFA tells us is that \text_ = \eta' \circ \bigotimes_d \text_ \circ \eta^* where

η*

and

η'

are re-indexing without actual arithmetic in

R

.

Counting the number of multi-dimensional transformations

Notice that the condition for transforming

DFT
\omegan
into \eta' \circ \bigotimes_d \text_ \circ \eta^* relies on "an" additive group isomorphism

η

from

(Zn,+,0)

to .Any additive group isomorphism will work.To count the number of ways transforming
DFT
\omegan
into,we only need to count the number of additive group isomorphisms from

(Zn,+,0)

to \prod_d (\mathbb_, +, 0), or alternative, the number of additive group automorphisms on .Since

(Zn,+,0)

is cyclic, any automorphism can be written as

1\mapstog

where

g

is a generator of

(Zn,+,0)

.By the definition of,

g

's are exactly those coprime to

n

.Therefore, there are exactly

\varphi(n)

many such maps where

\varphi

is the Euler's totient function.The smallest example is

n=6

where

\varphi(n)=2

, demonstrating the two maps in the literature: the "CRT mapping" and the "Ruritanian mapping".

See also

References