Discrete Fourier Transform (DFT)

Let be a field and a primitive -th root of unity (so by definition the natural number divides the order of the multiplicative group ). The DFT matrix is defined by:

and the inverse DFT matrix is given by .

The discrete Fourier transform of length is the -linear map:

which evaluates a polynomial from of degree strictly less than at the distinct points . The group elements being distinct for the following reason: let a group element of order ; for any , and . If for , then with , a contradiction.

For any :

As in any field, , for a primitive -th root of unity , since , and is also a primitive -th root of unity.

Thus , which in turn implies . The inverse discrete Fourier transform is thus defined if is invertible in (the characteristic of is strictly greater than ).

When is a finite field this transform is also called Number Theoretic Transform (NTT).

Note that we can consider a variant of the DFT where the vector holds points of an elliptic curve group defined over a finite field , which we call EC-DFT. The addition is then the elliptic curve point addition and the multiplication with roots of unity is the elliptic curve scalar multiplication (the roots of unity being defined over a prime field can be mapped to scalars).

Convolution product with the DFT

One can check that the -DFT is an homomorphism from to where is the convolution product 1 and is the element-wise multiplication: from which follows.

Aside:

One way to see it is to remark that the DFT for field elements is a ring isomorphism (with inverse DFT-1) given by the Chinese Remainder Theorem (CRT)

The first isomorphism corresponds to the fact that is a ring (of polynomials in taken modulo ) and an -vector space of dimension . The second one is the CRT factorization of as the ideals are pairwise coprime so their intersection is their product . Indeed, the DFT maps to . The inverse map comes down to the Lagrange interpolation (based on partial fraction decomposition) or Bézout (based on Bézout’s identity, whose coefficients can be computed with the extended Euclidean algorithm).

The Fast Fourier Transform (FFT)

The FFT from Cooley and Tukey (and Gauss) splits the computation of a DFT of size into the computations of DFTs of size (inner sum) and DFTs of size (outer sum), for and :

What follows is a reproduction of the derivation of the above FFT expression from the DFT from the section 2.3 of An Approach to Low-power, High-performance, Fast Fourier Transform Processor Design, Bevan M. Baas, 1999. The input vector and output vector are reshaped to form matrices and as follows: for integers , , , and .

Plugging this reindexing into the DFT equation we obtain (where , and is a primitive -th root of unity):

With a column-wise reshape of (ie. ) and row-wise reshape of (ie. ), we find the Cooley-Tuckey FFT:

Radix-2 decimation in time vs. decimation in frequency

The terminology comes from the Digital Signal Processing community where the DFT maps a signal (DFT input) to its frequencies (DFT output).

The radices are the prime factors from the decomposition of the DFT domain size . Typically so the FFT is radix-2. We consider .

Decimation in time (DIT)

From , choosing , : the input sequence of the DFT is decomposed into the even- and odd-indexed subsequences and :

which amounts to the “textbook FFT formula”, with a change of variable, and for :

Thus we obtain a recursive definition of the DFT: .

Decimation in frequency (DIF)

From , choosing , : the output sequence of the DFT is decomposed into the even- and odd-indexed subsequences and :

Hence the recursive definition of the DFT: and .

There is a nice symmetry: in the DIT, the input sequence decomposed in even- and odd- indexed subsequences, and the output sequence is decomposed in top and bottom subsequences; and vice-versa for the DIF.

Prime factor algorithm (FFT variant)

This algorithm allows computing FFTs on domains of size whose factorization is included in the factorization of . Let be a primitive -th root of unity.

When and are coprime then the Chinese Remainder Theorem (CRT) allows to re-index the DFT of size in such a way the inner DFTs don’t have to be multiplied by the extra factors .

We start from the expression of the DFT for : We re-index both input and output coefficients and thanks to the ring isomorphism given by the CRT. It turns out that certain combinations of input and output mappings allow getting rid of the extra factors . Let’s take as input mapping the CRT forward mapping . Hence, by Bézout for , , and , we obtain . As output mapping, we take the Good’s mapping . We could also have permuted the input and output mappings. Applying the two mappings, we get

So in the same way as implied by the equation , we compute FFTs of length , transpose the matrix, and compute FFTs of length . The cost of the transposition is somewhat negligible compared to the FFTs since it only changes the data layout.

Complexity: assuming and for small prime : .

Footnotes

  1. where .