**Search Mathematics of the DFT**

Book Index | Global Index

**Would you like to be notified by email when Julius Orion Smith III publishes a new entry into his blog?**

### Number Theoretic Transform

The *number theoretic transform* is based on generalizing the
th primitive root of unity (see §3.12) to a
``quotient ring'' instead of the usual field of complex numbers. Let
denote a primitive th root of unity. We have been using
in the field of complex numbers, and it of course
satisfies , making it a root of unity; it also has the
property that visits all of the ``DFT frequency points'' on
the unit circle in the plane, as goes from 0 to .

In a number theory transform, is an *integer* which
satisfies

where

is a prime integer. From number theory, for each

prime
number there exists at least one primitive root

such that

(modulo

) visits all of the numbers

through

*in some order*, as

goes from

to

. Since

for all integers

(another result from number
theory),

is also an

th root of unity, where

is the
transform size. (More generally,

can be any integer divisor

of

, in which case we use

as the generator of the
numbers participating in the transform.)

When the number of elements in the transform is composite, a ``fast
number theoretic transform'' may be constructed in the same manner as
a fast Fourier transform is constructed from the DFT, or as the
prime factor algorithm (or Winograd transform) is constructed for
products of small mutually prime factors [43].

Unlike the DFT, the number theoretic transform does not transform to a
meaningful ``frequency domain''. However, it has analogous theorems,
such as the convolution theorem, enabling it to be used for fast
convolutions and correlations like the various FFT algorithms.

An interesting feature of the number theory transform is that all
computations are *exact* (integer multiplication and addition
modulo a prime integer). There is no round-off error. This feature
has been used to do fast convolutions to multiply extremely large
numbers, such as are needed when computing to millions of digits
of precision.

**Previous:** The Discrete
Cosine Transform (DCT)**Next:** FFT Software

**About the Author: ** Julius Orion Smith III
Julius Smith's background is in electrical engineering (BS Rice 1975, PhD Stanford 1983). He is presently Professor of Music and (by courtesy) of Electrical Engineering at

Stanford's Center for Computer Research in Music and Acoustics (CCRMA), teaching courses and pursuing research related to signal processing applied to music and audio systems. See

http://ccrma.stanford.edu/~jos/ for details.