An Illustrated Introduction to the Truncated Fourier Transform

by   Paul Vrbik, et al.

The Truncated Fourier Transform (TFT) is a variation of the Discrete Fourier Transform (DFT/FFT) that allows for input vectors that do NOT have length 2^n for n a positive integer. We present the univariate version of the TFT, originally due to Joris van der Hoeven, heavily illustrating the presentation in order to make these methods accessible to a broader audience.



There are no comments yet.


page 1

page 2

page 3

page 4


The inverse cyclotomic Discrete Fourier Transform algorithm

The proof of the theorem concerning to the inverse cyclotomic Discrete F...

An in-place truncated Fourier transform

We show that simple modifications to van der Hoeven's forward and invers...

Interesting Open Problem Related to Complexity of Computing the Fourier Transform and Group Theory

The Fourier Transform is one of the most important linear transformation...

A promotion for odd symmetric discrete Fourier transform

DFT is the numerical implementation of Fourier transform (FT), and it ha...

Deriving the Variance of the Discrete Fourier Transform Test Using Parseval's Theorem

The discrete Fourier transform test is a randomness test included in NIS...

midiVERTO: A Web Application to Visualize Tonality in Real Time

This paper presents a web application for visualizing the tonality of a ...

Numerical Algorithms for the Computation of Generalized Prolate Spheroidal Functions

Generalized Prolate Spheroidal Functions (GPSF) are the eigenfunctions o...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

In 1965 Cooley and Tukey developed the Discrete Fourier Transform (dft) to recover continuous functions from discrete samples. This was a landmark discovery because it allowed for the digital manipulation of analogue signals (like sound) by computers. Soon after a variant called the Fast Fourier Transform (fft) eclipsed the dft to the extent that fft is often mistakenly substituted for dft. As its name implies, the fft is a method for computing the dft faster.

ffts have an interesting application in Computer Algebra. Let be a ring with a unit. If has a primitive th root of unity with (i.e. ) then the fft computes the product of two polynomials with in operations in . Unfortunately, when is sufficiently far from a power of two many computations wasted. This deficiency was addressed by the signal processing community using a method called fft-pruning [3]. However, the difficult inversion of this method is due to van der Hoeven [4][5].

In Section 2 we outline the dft, including a method for its non-recursive implementation. In Section 3 we develop the “pruned” variant, called Truncated Fourier Transform (tft). Finally, in Section 4, we show how the tft can be inverted and outline the algorithm for doing so in Section 5.

2 The Discrete Fourier Transform

For this paper let be a ring with a unit and an th root of unity. The Discrete Fourier Transform***In signal processing community this is called the “decimation-in-time” variant of the fft., with respect to , of vector is the vector with

Alternatively we can view these -tuples as encoding the coefficients of polynomials from and define the dft with respect to as the mapping

We let the relationship between and its coefficients be implicit and write

when .

The dft can be computed efficiently using binary splitting. This method requires evaluation only at for , rather than at all . To compute the dft of with respect to we write

and recursively compute the dft of and with respect to :

Finally, we construct according to

This description has a natural implementation as a recursive algorithm, but in practice it is often more efficient to implement an in-place algorithm that eliminates the overhead of creating recursive stacks.


Let and be a positive integers and let for . The length- bitwise reverse of is given by


and because


Notice if we were to write 3, 24, 11, and 26 as a binary numbers to five digits we have 00011 reverses to 11000 and 01011 reverses to 11010 — in fact this is the inspiration for the name “bitwise reverse.”

For the in-place non-recursive dft algorithm, we require only one vector of length . Initially, at step zero, this vector is

and is updated (incrementally) at steps by the rule


where and for all , . Note that two additions and one multiplication are done in (1) as one product is merely the negation of the other.

We illustrate the dependencies of the values in (1) with

We call this a “butterfly” after the shape it forms and may say controls the width — the value of which decreases as increases. By placing these butterflies on a grid (Figure 1) we can see which values of are required to compute particular entires of (and vice-versa). For example

denotes that and are required to determine and (and vice-versa).

Figure 1: Schematic representation of Equation (1) using butterflies to illustrate the value dependencies at various steps . The grid has rows and columns for illustrating the values.

Using induction over ,

for all and [4]. In particular, when and , we have

for all . That is, is a (specific) permutation of as illustrated in Figure 2.

The key property of the dft is that it is straightforward to invert, that is to recover from :


since whenever . This yields a polynomial multiplication algorithm that does operations in (see [1, §4.7] for the outline of this algorithm).

Figure 2: The Discrete Fourier Transform for . The top row, corresponding to , are the initial values . The bottom row, corresponding to , is a permutation of (the result of the DFT on ).

3 The Truncated Fourier Transform

The motivation behind the Truncated Fourier Transform (tft) is the observation that many computations are wasted when the length of (the input) is not a power of two.The tft is exactly equivalent to a technique called “fft pruning” in the signal processing literature [3]. This is entirely the fault of the strategy where one “completes” the -tuple by setting when to artificially extend the length of to the nearest power of two (so the dft can be executed as usual).

However, despite the fact that we may only want components of , the dft will calculate all of them. Thus computation is wasted. We illustrate this in Figures 3 and 4. This type of wasted computation is relevant when using the dft to multiply polynomials — their products are rarely of degree one less some power of two.

The definition of the tft is similar to that of the dft with the exception that the input and output vector ( resp. ) are not necessarily of length some power of two. More precisely the tft of an -tuple is the -tuple

where , (usually ) and a th root of unity.

Figure 3: The dft with “artificial” zero points (large black dots).
Figure 4: Removing all unnecessary computations from Figure 3 gives the schematic representation of the tft.

van der Hoeven [4] gives a more general description of the tft where one can choose an initial vector and target vector . Provided the ’s are distinct one can carry out the tft by considering the full dft and removing all computations not required for the desired output. In this paper, we restrict our discussion to that of the scenario in Figure 4 (where the input and output are the same initial segments) because it can be used for polynomial multiplication, and because it yields the most improvement.

If we only allow ourselves to operate in a size vector it is straightforward to modify the in-place dft algorithm from the previous section to execute the tft. (It should be emphasized that this only saves computation and not space. For a “true” in-place tft algorithm that operates in an array of size , see Harvey and Roche’s [2].) At stage it suffices to compute with where .This is a correction to the bound given in [5] as pointed out in [4].

Theorem 1.

Let , and be a primitive th root of unity in . The tft of an -tuple with respect to can be computed using at most additions and multiplications of powers of .


Let ; at stage we compute . So, in addition to we compute

more values. Therefore, in total, we compute at most

values . The result follows. ∎

4 Inverting The Truncated Fourier Transform

Unfortunately, the tft cannot be inverted by merely doing another tft with and adjusting the output by some constant factor like inverse of the dft. Simply put: we are missing information and must account for this.


Let , , with a th primitive root of unity. Setting , the tft of at 5 is

Now, to show the tft of this with respect to is not , define

The tft of with respect to is

which is not a constant multiple of .

This discrepancy is caused by the completion of to — we should have instead completed to .

To invert the tft we use the fact that whenever two values among

are known, that the other values can be deduced. That is, if two values of some butterfly are known then the other two values can be calculated using (1) as the relevant matrix is invertible. Moreover, these relations only involve shifting (multiplication and division by two), additions, subtractions and multiplications by roots of unity — an ideal scenario for implementation.

As with dft, observe that can be calculated from . This is because all the butterfly relations necessary to move up like this never require for any and . This is illustrated in Figure 5. More generally, we have that

is sufficient information to compute

provided that . (In Algorithm 1, that follows, we call this a “self-contained push up”.)

Figure 5: The computations in the boxes are self contained.

5 Inverse tft Algorithm

Finally, in this section, we present a simple recursive description of the inverse tft algorithm for the case we have restricted ourselves to (all zeroes packed at the end). The algorithm operates in a length array for which we assume access; here corresponds to , a th primitive root of unity. Initially, the content of the array is

where is the result of the tft on .

In keeping with our “Illustrated” description we use pictures, like Figure 6, to indicate what values are known (solid dots ) and what value to calculate (empty dot ). For instance, “push down with Figure 6”, is shorthand for: use and to determine . We emphasize with an arrow that this new value should also overwrite the one at . This calculation is easily accomplished using (1) with a caveat: the values and are not explicitly known. What is known is , and therefore , and some array position . Observe that is recovered by (the quotient of ).

Figure 6: Overwrite with .

The full description of the inverse tft follows in Algorithm 1; note that the initial call is InvTFT. A visual depiction of Algorithm 1 is given in Figure 9. A sketch of a proof of its correctness follows.

Initial call :  InvTFT;
1 middle
2[0.5em] ;
4[1em] if then
5       Base case---do nothing;
6       return null;
7 else if then
8       Push up the self-contained region to ;
9       Push down to with  ;
10       InvTFT;
11       ;
12       Push up (in pairs) to with  ;
14 else if then
15       Push down to with ;
16       InvTFT;
17       Push up to with ;
Algorithm 1 InvTFT
Theorem 2.

Algorithm 1, initially called with and given access to the zero-indexed length array


will terminate with


where (3) is the result of the tft on (4).


Let , , and be the values of head, tail, and last at the th recursive call. Consider the integer sequences given by

If then we have termination. Otherwise, either branch (7) executes giving

and thus , or branch (13) executes, giving

and thus .

Neither branch can run forever since causes termination and means either strictly decreases or condition (13) fails, forcing termination. ∎

Sketch of correctness.

Figure 7 and Figure 8 demonstrate that self contained regions can be exploited to obtain the initial values required to complete the inversion. That is to say, for , that

can always be calculated from

(a) Line (8): push up the self contained (dashed) region. This yields values sufficient to push down at line (9).
(b) This enables us to make a recursive call on the dashed region (line (12)). By our induction hypothesis this brings all points at to .
(c) Sufficient points at are known to move to at line (13).
Figure 7: (i.e. at least half the values are at ).
(d) Initially there is sufficient information to push down at line (14).
(e) This enables us to make the prescribed recursive call at line (15).
(f) By the induction hypothesis this brings the values in the dashed region to , leaving enough information to move up at line (16).
Figure 8: (i.e. less than half the values are at ).
(a) Initial state of the algorithm. Grey dots are the result of the forward tft; larger grey dots are zeros.
(b) tailLeftMiddle. Push up; calculate from (contained region). Then push down.
(c) Recursive call on right half.
(d) tailLeftMiddle. Push down with.
(e) Recursive call on left half.
(f) tailLeftMiddle. Push up the contained (dashed) region then push down.
(g) Recursive call on right half.
(h) Hiding details. The result of (g).
(i) Finish step (e) by pushing up.
(j) Finish step (c) by pushing up.
(k) Resolve the original call by pushing up.
(l) Done.
Figure 9: Schematic representation of the recursive computation of the inverse tft for and .

6 Conclusions

The Truncated Fourier Transform is a novel and elegant way to reduce the number of computations of a dft-based computation by a possible factor of two (which may be significant). Additionally, with the advent of Harvey and Roche’s paper [2], it is possible to save as much space as computation. The hidden “cost” of working with the tft algorithm is the increased difficulty of determining the inverse tft. Although in most cases this is still less costly than the inverse dft, the algorithm is no doubt more difficult to implement.


The author wishes to thank Dr. Dan Roche and Dr. Éric Schost for reading a draft of this paper and offering suggestions.


  • [1] K. O. Geddes, S. R. Czapor, and G. Labahn. Algorithms for Computer Algebra. Kluwer Academic Publishers, 1992.
  • [2] David Harvey and Daniel S. Roche. An in-place truncated fourier transform and applications to polynomial multiplication. In Proceedings of the 2010 International Symposium on Symbolic and Algebraic Computation, ISSAC ’10, pages 325–329, New York, NY, USA, 2010. ACM.
  • [3] H.V. Sorensen and C.S. Burrus. Efficient computation of the dft with only a subset of input or output points. Signal Processing, IEEE Transactions on, 41(3):1184 –1200, mar 1993.
  • [4] J. van der Hoeven. Notes on the Truncated Fourier Transform. Technical report, Université Paris-Sud, Orsay, France, 2008.
  • [5] Joris van der Hoeven. The truncated fourier transform and applications. In ISSAC ’04: Proceedings of the 2004 international symposium on Symbolic and algebraic computation, pages 290–296, New York, NY, USA, 2004. ACM.