Number Theoretic Transform
   HOME

TheInfoList



OR:

In
mathematics Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
, the discrete Fourier transform over a ring generalizes the
discrete Fourier transform In mathematics, the discrete Fourier transform (DFT) converts a finite sequence of equally-spaced samples of a function into a same-length sequence of equally-spaced samples of the discrete-time Fourier transform (DTFT), which is a complex- ...
(DFT), of a function whose values are commonly
complex number In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted , called the imaginary unit and satisfying the equation i^= -1; every complex number can be expressed in the form ...
s, over an arbitrary
ring Ring may refer to: * Ring (jewellery), a round band, usually made of metal, worn as ornamental jewelry * To make a sound with a bell, and the sound made by a bell :(hence) to initiate a telephone connection Arts, entertainment and media Film and ...
.


Definition

Let R be any
ring Ring may refer to: * Ring (jewellery), a round band, usually made of metal, worn as ornamental jewelry * To make a sound with a bell, and the sound made by a bell :(hence) to initiate a telephone connection Arts, entertainment and media Film and ...
, let n\geq 1 be an integer, and let \alpha \in R be a principal ''n''th root of unity, defined by:Martin Fürer,
Faster Integer Multiplication
, STOC 2007 Proceedings, pp. 57–66. Section 2: The Discrete Fourier Transform.
: \begin & \alpha^n = 1 \\ & \sum_^ \alpha^ = 0 \text 1 \leq k < n \qquad (1) \end The discrete Fourier transform maps an ''n''-tuple (v_0,\ldots,v_) of elements of R to another ''n''-tuple (f_0,\ldots,f_) of elements of R according to the following formula: :f_k = \sum_^ v_j\alpha^.\qquad (2) By convention, the tuple (v_0,\ldots,v_) is said to be in the ''time domain'' and the index j is called ''time''. The tuple (f_0,\ldots,f_) is said to be in the ''frequency domain'' and the index k is called ''frequency''. The tuple (f_0,\ldots,f_) is also called the ''
spectrum A spectrum (plural ''spectra'' or ''spectrums'') is a condition that is not limited to a specific set of values but can vary, without gaps, across a continuum. The word was first used scientifically in optics to describe the rainbow of colors i ...
'' of (v_0,\ldots,v_). This terminology derives from the applications of Fourier transforms in
signal processing Signal processing is an electrical engineering subfield that focuses on analyzing, modifying and synthesizing ''signals'', such as audio signal processing, sound, image processing, images, and scientific measurements. Signal processing techniq ...
. If R is an
integral domain In mathematics, specifically abstract algebra, an integral domain is a nonzero commutative ring in which the product of any two nonzero elements is nonzero. Integral domains are generalizations of the ring of integers and provide a natural set ...
(which includes
fields Fields may refer to: Music * Fields (band), an indie rock band formed in 2006 * Fields (progressive rock band), a progressive rock band formed in 1971 * ''Fields'' (album), an LP by Swedish-based indie rock band Junip (2010) * "Fields", a song b ...
), it is sufficient to choose \alpha as a primitive ''n''th root of unity, which replaces the condition (1) by: :\alpha^ \ne 1 for 1 \leq k < n Proof: take \beta = \alpha^k with 1 \leq k < n. Since \alpha^n=1, \beta^n=(\alpha^n)^k=1, giving: :\beta^n-1 = (\beta-1)\left(\sum_^ \beta^j\right) = 0 where the sum matches (1). Since \alpha is a primitive root of unity, \beta - 1 \ne 0. Since R is an integral domain, the sum must be zero. ∎ Another simple condition applies in the case where ''n'' is a power of two: (1) may be replaced by \alpha^ = -1.


Inverse

The inverse of the discrete Fourier transform is given as: :v_j = \frac\sum_^ f_k\alpha^.\qquad (3) where 1/n is the multiplicative inverse of n in R (if this inverse does not exist, the DFT cannot be inverted). Proof: Substituting (2) into the right-hand-side of (3), we get : \begin & \frac\sum_^ f_k\alpha^ \\ = & \frac\sum_^\sum_^ v_\alpha^\alpha^ \\ = & \frac\sum_^ v_ \sum_^\alpha^. \end This is exactly equal to v_j, because \sum_^\alpha^=0 when j'\neq j (by (1) with k=j'-j), and \sum_^\alpha^=n when j'=j. ∎


Matrix formulation

Since the discrete Fourier transform is a
linear operator In mathematics, and more specifically in linear algebra, a linear map (also called a linear mapping, linear transformation, vector space homomorphism, or in some contexts linear function) is a mapping V \to W between two vector spaces that pre ...
, it can be described by
matrix multiplication In mathematics, particularly in linear algebra, matrix multiplication is a binary operation that produces a matrix from two matrices. For matrix multiplication, the number of columns in the first matrix must be equal to the number of rows in the s ...
. In matrix notation, the discrete Fourier transform is expressed as follows: : \beginf_0\\f_1\\\vdots\\f_\end = \begin 1&1&1&\cdots &1 \\ 1&\alpha&\alpha^2&\cdots&\alpha^ \\ 1&\alpha^2&\alpha^4&\cdots&\alpha^\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ 1&\alpha^&\alpha^&\cdots&\alpha^\\ \end \beginv_0\\v_1\\\vdots\\v_\end. The matrix for this transformation is called the
DFT matrix In applied mathematics, a DFT matrix is an expression of a discrete Fourier transform (DFT) as a transformation matrix, which can be applied to a signal through matrix multiplication. Definition An ''N''-point DFT is expressed as the multiplicati ...
. Similarly, the matrix notation for the inverse Fourier transform is : \beginv_0\\v_1\\\vdots\\v_\end = \frac\begin 1&1&1&\cdots &1 \\ 1&\alpha^&\alpha^&\cdots&\alpha^ \\ 1&\alpha^&\alpha^&\cdots&\alpha^\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ 1&\alpha^&\alpha^&\cdots&\alpha^ \end \beginf_0\\f_1\\\vdots\\f_\end.


Polynomial formulation

Sometimes it is convenient to identify an n-tuple (v_0,\ldots,v_) with a formal polynomial :p_v(x) = v_0 + v_1x + v_2x^2 + \cdots + v_x^. \, By writing out the summation in the definition of the discrete Fourier transform (2), we obtain: :f_k = v_0 + v_1\alpha^ + v_2\alpha^ + \cdots + v_\alpha^. \, This means that f_k is just the value of the polynomial p_v(x) for x=\alpha^k, i.e., :f_k = p_v(\alpha^k).\, The Fourier transform can therefore be seen to relate the ''coefficients'' and the ''values'' of a polynomial: the coefficients are in the time-domain, and the values are in the frequency domain. Here, of course, it is important that the polynomial is evaluated at the nth roots of unity, which are exactly the powers of \alpha. Similarly, the definition of the inverse Fourier transform (3) can be written: :v_j = \frac(f_0 + f_1\alpha^ + f_2\alpha^ + \cdots + f_\alpha^).\qquad (5) With :p_f(x) = f_0 + f_1x + f_2x^2 + \cdots + f_x^, this means that :v_j = \fracp_f(\alpha^). We can summarize this as follows: if the ''values'' of p(x) are the ''coefficients'' of q(x), then the ''values'' of q(x) are the ''coefficients'' of p(x), up to a scalar factor and reordering.


Special cases


Complex numbers

If F= is the field of complex numbers, then the nth roots of unity can be visualized as points on the
unit circle In mathematics, a unit circle is a circle of unit radius—that is, a radius of 1. Frequently, especially in trigonometry, the unit circle is the circle of radius 1 centered at the origin (0, 0) in the Cartesian coordinate system in the Eucl ...
of the
complex plane In mathematics, the complex plane is the plane formed by the complex numbers, with a Cartesian coordinate system such that the -axis, called the real axis, is formed by the real numbers, and the -axis, called the imaginary axis, is formed by the ...
. In this case, one usually takes :\alpha=e^, which yields the usual formula for the complex discrete Fourier transform: :f_k = \sum_^ v_j e^. Over the complex numbers, it is often customary to normalize the formulas for the DFT and inverse DFT by using the scalar factor \frac in both formulas, rather than 1 in the formula for the DFT and \frac in the formula for the inverse DFT. With this normalization, the DFT matrix is then unitary. Note that \sqrt does not make sense in an arbitrary field.


Finite fields

If F=GF(q) is a
finite field In mathematics, a finite field or Galois field (so-named in honor of Évariste Galois) is a field that contains a finite number of elements. As with any field, a finite field is a set on which the operations of multiplication, addition, subtr ...
, where q is a
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 ways ...
power, then the existence of a primitive nth root automatically implies that n
divides In mathematics, a divisor of an integer n, also called a factor of n, is an integer m that may be multiplied by some integer to produce n. In this case, one also says that n is a multiple of m. An integer n is divisible or evenly divisible by ...
q-1, because the
multiplicative order In number theory, given a positive integer ''n'' and an integer ''a'' coprime to ''n'', the multiplicative order of ''a'' modulo ''n'' is the smallest positive integer ''k'' such that a^k\ \equiv\ 1 \pmod n. In other words, the multiplicative order ...
of each element must divide the size of the
multiplicative group In mathematics and group theory, the term multiplicative group refers to one of the following concepts: *the group under multiplication of the invertible elements of a field, ring, or other structure for which one of its operations is referred to ...
of F, which is q-1. This in particular ensures that n=\underbrace_ is invertible, so that the notation \frac in (3) makes sense. An application of the discrete Fourier transform over GF(q) is the reduction of Reed–Solomon codes to
BCH code In coding theory, the Bose–Chaudhuri–Hocquenghem codes (BCH codes) form a class of cyclic error-correcting codes that are constructed using polynomials over a finite field (also called ''Galois field''). BCH codes were invented in 1959 ...
s in
coding theory Coding theory is the study of the properties of codes and their respective fitness for specific applications. Codes are used for data compression, cryptography, error detection and correction, data transmission and data storage. Codes are stud ...
. Such transform can be carried out efficiently with proper fast algorithms, for example,
cyclotomic fast Fourier transform The cyclotomic fast Fourier transform is a type of fast Fourier transform algorithm over finite fields.S.V. Fedorenko and P.V. Trifonov, This algorithm first decomposes a DFT into several circular convolutions, and then derives the DFT results fro ...
.


Number-theoretic transform

The number-theoretic transform (NTT) is obtained by specializing the discrete Fourier transform to F=/p, the integers modulo a prime . This is a
finite field In mathematics, a finite field or Galois field (so-named in honor of Évariste Galois) is a field that contains a finite number of elements. As with any field, a finite field is a set on which the operations of multiplication, addition, subtr ...
, and primitive th roots of unity exist whenever divides p-1, so we have p=\xi n+1 for a positive integer . Specifically, let \omega be a primitive (p-1)th root of unity, then an th root of unity \alpha can be found by letting \alpha=\omega^. e.g. for p=5, \alpha = 2 :\begin2^&=2 \pmod 5\\2^&=4 \pmod 5\\2^&=3 \pmod 5\\2^&=1 \pmod 5\end when N=4 : \begin F(0) \\ F(1) \\ F(2) \\ F(3) \end = \begin 1 & 1 & 1 & 1 \\ 1 & 2 & 4 & 3 \\ 1 & 4 & 1 & 4 \\ 1 & 3 & 4 & 2 \end \begin f(0) \\ f(1) \\ f(2) \\ f(3) \end The number theoretic transform may be meaningful in the
ring Ring may refer to: * Ring (jewellery), a round band, usually made of metal, worn as ornamental jewelry * To make a sound with a bell, and the sound made by a bell :(hence) to initiate a telephone connection Arts, entertainment and media Film and ...
\mathbb/m, even when the modulus is not prime, provided a principal root of order exists. Special cases of the number theoretic transform such as the Fermat Number Transform (), used by the
Schönhage–Strassen algorithm The Schönhage–Strassen algorithm is an asymptotically fast multiplication algorithm for large integers. It was developed by Arnold Schönhage and Volker Strassen in 1971.A. Schönhage and V. Strassen,Schnelle Multiplikation großer Zahlen, ''C ...
, or Mersenne Number Transform () use a composite modulus.


Discrete weighted transform

The discrete weighted transform (DWT) is a variation on the discrete Fourier transform over arbitrary rings involving
weighting The process of weighting involves emphasizing the contribution of particular aspects of a phenomenon (or of a set of data) over others to an outcome or result; thereby highlighting those aspects in comparison to others in the analysis. That i ...
the input before transforming it by multiplying elementwise by a weight vector, then weighting the result by another vector. The
Irrational base discrete weighted transform In mathematics, the irrational base discrete weighted transform (IBDWT) is a variant of the fast Fourier transform using an irrational base; it was developed by Richard Crandall (Reed College), Barry Fagin (Dartmouth College) and Joshua Doenias ...
is a special case of this.


Properties

Most of the important attributes of the complex DFT, including the inverse transform, 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.g. ...
, and most
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 th ...
(FFT) algorithms, depend only on the property that the kernel of the transform is a principal root of unity. These properties also hold, with identical proofs, over arbitrary rings. In the case of fields, this analogy can be formalized by the
field with one element In mathematics, the field with one element is a suggestive name for an object that should behave similarly to a finite field with a single element, if such a field could exist. This object is denoted F1, or, in a French–English pun, Fun. The name ...
, considering any field with a primitive ''n''th root of unity as an algebra over the extension field \mathbf_. In particular, the applicability of O(n \log n)
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 th ...
algorithms to compute the NTT, combined with the convolution theorem, mean that the number-theoretic transform gives an efficient way to compute exact
convolution In mathematics (in particular, functional analysis), convolution is a operation (mathematics), mathematical operation on two function (mathematics), functions ( and ) that produces a third function (f*g) that expresses how the shape of one is ...
s of integer sequences. While the complex DFT can perform the same task, it is susceptible to
round-off error A roundoff error, also called rounding error, is the difference between the result produced by a given algorithm using exact arithmetic and the result produced by the same algorithm using finite-precision, rounded arithmetic. Rounding errors are d ...
in finite-precision
floating point In computing, floating-point arithmetic (FP) is arithmetic that represents real numbers approximately, using an integer with a fixed precision, called the significand, scaled by an integer exponent of a fixed base. For example, 12.345 can be ...
arithmetic; the NTT has no round-off because it deals purely with fixed-size integers that can be exactly represented.


Fast algorithms

For the implementation of a "fast" algorithm (similar to how
FFT 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 the ...
computes the DFT), it is often desirable that the transform length is also highly composite, e.g., 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-negative ...
. However, there are specialized fast Fourier transform algorithms for finite fields, such as Wang and Zhu's algorithm,
Yao Wang Yao Wang is a Chinese-American video engineer whose research topics include networked video, video coding, computer vision, medical imaging, and the use of machine learning techniques to diagnose lymphedema and concussions. She is a professor ...
and Xuelong Zhu, "A fast algorithm for the Fourier transform over finite fields and its VLSI implementation", IEEE Journal on Selected Areas in Communications 6(3)572–577, 1988
that are efficient regardless of whether the transform length factors.


See also

* Discrete Fourier transform (complex) *
Fourier transform on finite groups In mathematics, the Fourier transform on finite groups is a generalization of the discrete Fourier transform from cyclic to arbitrary finite groups. Definitions The Fourier transform of a function f : G \to \Complex at a representation \varrho ...
*
Gauss sum In algebraic number theory, a Gauss sum or Gaussian sum is a particular kind of finite sum of roots of unity, typically :G(\chi) := G(\chi, \psi)= \sum \chi(r)\cdot \psi(r) where the sum is over elements of some finite commutative ring , is a ...
*
Convolution In mathematics (in particular, functional analysis), convolution is a operation (mathematics), mathematical operation on two function (mathematics), functions ( and ) that produces a third function (f*g) that expresses how the shape of one is ...
*
Least-squares spectral analysis Least-squares spectral analysis (LSSA) is a method of estimating a frequency spectrum, based on a least squares fit of sinusoids to data samples, similar to Fourier analysis. Fourier analysis, the most used spectral method in science, generally ...
*
Multiplication algorithm A multiplication algorithm is an algorithm (or method) to multiply two numbers. Depending on the size of the numbers, different algorithms are more efficient than others. Efficient multiplication algorithms have existed since the advent of the de ...


References


External links

* http://www.apfloat.org/ntt.html {{DEFAULTSORT:Discrete Fourier Transform (General) Fourier analysis