Discrete Fourier transform (general)
In mathematics, the discrete Fourier transform over an arbitrary ring generalizes the discrete Fourier transform of a function whose values are complex numbers.
Definition
Let [math]\displaystyle{ R }[/math] be any ring, let [math]\displaystyle{ n\geq 1 }[/math] be an integer, and let [math]\displaystyle{ \alpha \in R }[/math] be a principal nth root of unity, defined by:[1]
- [math]\displaystyle{ \begin{align} & \alpha^n = 1 \\ & \sum_{j=0}^{n-1} \alpha^{jk} = 0 \text{ for } 1 \leq k \lt n \qquad (1) \end{align} }[/math]
The discrete Fourier transform maps an n-tuple [math]\displaystyle{ (v_0,\ldots,v_{n-1}) }[/math] of elements of [math]\displaystyle{ R }[/math] to another n-tuple [math]\displaystyle{ (f_0,\ldots,f_{n-1}) }[/math] of elements of [math]\displaystyle{ R }[/math] according to the following formula:
- [math]\displaystyle{ f_k = \sum_{j=0}^{n-1} v_j\alpha^{jk}.\qquad (2) }[/math]
By convention, the tuple [math]\displaystyle{ (v_0,\ldots,v_{n-1}) }[/math] is said to be in the time domain and the index [math]\displaystyle{ j }[/math] is called time. The tuple [math]\displaystyle{ (f_0,\ldots,f_{n-1}) }[/math] is said to be in the frequency domain and the index [math]\displaystyle{ k }[/math] is called frequency. The tuple [math]\displaystyle{ (f_0,\ldots,f_{n-1}) }[/math] is also called the spectrum of [math]\displaystyle{ (v_0,\ldots,v_{n-1}) }[/math]. This terminology derives from the applications of Fourier transforms in signal processing.
If [math]\displaystyle{ R }[/math] is an integral domain (which includes fields), it is sufficient to choose [math]\displaystyle{ \alpha }[/math] as a primitive nth root of unity, which replaces the condition (1) by:[1]
- [math]\displaystyle{ \alpha^{k} \ne 1 }[/math] for [math]\displaystyle{ 1 \leq k \lt n }[/math]
Proof: take [math]\displaystyle{ \beta = \alpha^k }[/math] with [math]\displaystyle{ 1 \leq k \lt n }[/math]. Since [math]\displaystyle{ \alpha^n=1 }[/math], [math]\displaystyle{ \beta^n=(\alpha^n)^k=1 }[/math], giving:
- [math]\displaystyle{ \beta^n-1 = (\beta-1)\left(\sum_{j=0}^{n-1} \beta^j\right) = 0 }[/math]
where the sum matches (1). Since [math]\displaystyle{ \alpha }[/math] is a primitive root of unity, [math]\displaystyle{ \beta - 1 \ne 0 }[/math]. Since [math]\displaystyle{ R }[/math] 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 [math]\displaystyle{ \alpha^{n/2} = -1 }[/math].[1]
Inverse
The inverse of the discrete Fourier transform is given as:
- [math]\displaystyle{ v_j = \frac{1}{n}\sum_{k=0}^{n-1} f_k\alpha^{-jk}.\qquad (3) }[/math]
where [math]\displaystyle{ 1/n }[/math] is the multiplicative inverse of [math]\displaystyle{ n }[/math] in [math]\displaystyle{ R }[/math] (if this inverse does not exist, the DFT cannot be inverted).
Proof: Substituting (2) into the right-hand-side of (3), we get
- [math]\displaystyle{ \begin{align} & \frac{1}{n}\sum_{k=0}^{n-1} f_k\alpha^{-jk} \\ = {} & \frac{1}{n}\sum_{k=0}^{n-1}\sum_{j'=0}^{n-1} v_{j'}\alpha^{j'k}\alpha^{-jk} \\ = {} & \frac{1}{n}\sum_{j'=0}^{n-1} v_{j'} \sum_{k=0}^{n-1}\alpha^{(j'-j)k}. \end{align} }[/math]
This is exactly equal to [math]\displaystyle{ v_j }[/math], because [math]\displaystyle{ \sum_{k=0}^{n-1}\alpha^{(j'-j)k}=0 }[/math] when [math]\displaystyle{ j'\neq j }[/math] (by (1) with [math]\displaystyle{ k=j'-j }[/math]), and [math]\displaystyle{ \sum_{k=0}^{n-1}\alpha^{(j'-j)k}=n }[/math] when [math]\displaystyle{ j'=j }[/math]. ∎
Matrix formulation
Since the discrete Fourier transform is a linear operator, it can be described by matrix multiplication. In matrix notation, the discrete Fourier transform is expressed as follows:
- [math]\displaystyle{ \begin{bmatrix}f_0\\f_1\\\vdots\\f_{n-1}\end{bmatrix} = \begin{bmatrix} 1&1&1&\cdots &1 \\ 1&\alpha&\alpha^2&\cdots&\alpha^{n-1} \\ 1&\alpha^2&\alpha^4&\cdots&\alpha^{2(n-1)}\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ 1&\alpha^{n-1}&\alpha^{2(n-1)}&\cdots&\alpha^{(n-1)(n-1)}\\ \end{bmatrix} \begin{bmatrix}v_0\\v_1\\\vdots\\v_{n-1}\end{bmatrix}. }[/math]
The matrix for this transformation is called the DFT matrix.
Similarly, the matrix notation for the inverse Fourier transform is
- [math]\displaystyle{ \begin{bmatrix}v_0\\v_1\\\vdots\\v_{n-1}\end{bmatrix} = \frac{1}{n}\begin{bmatrix} 1&1&1&\cdots &1 \\ 1&\alpha^{-1}&\alpha^{-2}&\cdots&\alpha^{-(n-1)} \\ 1&\alpha^{-2}&\alpha^{-4}&\cdots&\alpha^{-2(n-1)}\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ 1&\alpha^{-(n-1)}&\alpha^{-2(n-1)}&\cdots&\alpha^{-(n-1)(n-1)} \end{bmatrix} \begin{bmatrix}f_0\\f_1\\\vdots\\f_{n-1}\end{bmatrix}. }[/math]
Polynomial formulation
Sometimes it is convenient to identify an [math]\displaystyle{ n }[/math]-tuple [math]\displaystyle{ (v_0,\ldots,v_{n-1}) }[/math] with a formal polynomial
- [math]\displaystyle{ p_v(x) = v_0 + v_1x + v_2x^2 + \cdots + v_{n-1}x^{n-1}. \, }[/math]
By writing out the summation in the definition of the discrete Fourier transform (2), we obtain:
- [math]\displaystyle{ f_k = v_0 + v_1\alpha^{k} + v_2\alpha^{2k} + \cdots + v_{n-1}\alpha^{(n-1)k}. \, }[/math]
This means that [math]\displaystyle{ f_k }[/math] is just the value of the polynomial [math]\displaystyle{ p_v(x) }[/math] for [math]\displaystyle{ x=\alpha^k }[/math], i.e.,
- [math]\displaystyle{ f_k = p_v(\alpha^k).\, }[/math]
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 [math]\displaystyle{ n }[/math]th roots of unity, which are exactly the powers of [math]\displaystyle{ \alpha }[/math].
Similarly, the definition of the inverse Fourier transform (3) can be written:
- [math]\displaystyle{ v_j = \frac{1}{n}(f_0 + f_1\alpha^{-j} + f_2\alpha^{-2j} + \cdots + f_{n-1}\alpha^{-(n-1)j}).\qquad (5) }[/math]
With
- [math]\displaystyle{ p_f(x) = f_0 + f_1x + f_2x^2 + \cdots + f_{n-1}x^{n-1}, }[/math]
this means that
- [math]\displaystyle{ v_j = \frac{1}{n}p_f(\alpha^{-j}). }[/math]
We can summarize this as follows: if the values of [math]\displaystyle{ p(x) }[/math] are the coefficients of [math]\displaystyle{ q(x) }[/math], then the values of [math]\displaystyle{ q(x) }[/math] are the coefficients of [math]\displaystyle{ p(x) }[/math], up to a scalar factor and reordering.[2]
Special cases
Complex numbers
If [math]\displaystyle{ F={\mathbb C} }[/math] is the field of complex numbers, then the [math]\displaystyle{ n }[/math]th roots of unity can be visualized as points on the unit circle of the complex plane. In this case, one usually takes
- [math]\displaystyle{ \alpha=e^{\frac{-2\pi i}{n}}, }[/math]
which yields the usual formula for the complex discrete Fourier transform:
- [math]\displaystyle{ f_k = \sum_{j=0}^{n-1} v_j e^{\frac{-2\pi i}{n}jk}. }[/math]
Over the complex numbers, it is often customary to normalize the formulas for the DFT and inverse DFT by using the scalar factor [math]\displaystyle{ \frac{1}{\sqrt{n}} }[/math] in both formulas, rather than [math]\displaystyle{ 1 }[/math] in the formula for the DFT and [math]\displaystyle{ \frac{1}{n} }[/math] in the formula for the inverse DFT. With this normalization, the DFT matrix is then unitary. Note that [math]\displaystyle{ \sqrt{n} }[/math] does not make sense in an arbitrary field.
Finite fields
If [math]\displaystyle{ F=GF(q) }[/math] is a finite field, where [math]\displaystyle{ q }[/math] is a prime power, then the existence of a primitive [math]\displaystyle{ n }[/math]th root automatically implies that [math]\displaystyle{ n }[/math] divides [math]\displaystyle{ q-1 }[/math], because the multiplicative order of each element must divide the size of the multiplicative group of [math]\displaystyle{ F }[/math], which is [math]\displaystyle{ q-1 }[/math]. This in particular ensures that [math]\displaystyle{ n=\underbrace{1+1+\cdots+1}_{n\ \rm times} }[/math] is invertible, so that the notation [math]\displaystyle{ \frac{1}{n} }[/math] in (3) makes sense.
An application of the discrete Fourier transform over [math]\displaystyle{ GF(q) }[/math] is the reduction of Reed–Solomon codes to BCH codes in coding theory. Such transform can be carried out efficiently with proper fast algorithms, for example, cyclotomic fast Fourier transform.
Number-theoretic transform
The number-theoretic transform (NTT)[3] is obtained by specializing the discrete Fourier transform to [math]\displaystyle{ F={\mathbb Z}/p }[/math], the integers modulo a prime p. This is a finite field, and primitive nth roots of unity exist whenever n divides [math]\displaystyle{ p-1 }[/math], so we have [math]\displaystyle{ p=\xi n+1 }[/math] for a positive integer ξ. Specifically, let [math]\displaystyle{ \omega }[/math] be a primitive [math]\displaystyle{ (p-1) }[/math]th root of unity, then an nth root of unity [math]\displaystyle{ \alpha }[/math] can be found by letting [math]\displaystyle{ \alpha=\omega^{\xi} }[/math].
e.g. for [math]\displaystyle{ p=5 }[/math], [math]\displaystyle{ \alpha = 2 }[/math]
- [math]\displaystyle{ \begin{align}2^{1}&=2 \pmod 5\\2^{2}&=4 \pmod 5\\2^{3}&=3 \pmod 5\\2^{4}&=1 \pmod 5\end{align} }[/math]
when [math]\displaystyle{ N=4 }[/math]
- [math]\displaystyle{ \begin{bmatrix} F(0) \\ F(1) \\ F(2) \\ F(3) \end{bmatrix} = \begin{bmatrix} 1 & 1 & 1 & 1 \\ 1 & 2 & 4 & 3 \\ 1 & 4 & 1 & 4 \\ 1 & 3 & 4 & 2 \end{bmatrix} \begin{bmatrix} f(0) \\ f(1) \\ f(2) \\ f(3) \end{bmatrix} }[/math]
The number theoretic transform may be meaningful in the ring [math]\displaystyle{ \mathbb{Z}/m }[/math], even when the modulus m is not prime, provided a principal root of order n exists. Special cases of the number theoretic transform such as the Fermat Number Transform (m = 2k+1), used by the Schönhage–Strassen algorithm, or Mersenne Number Transform[4] (m = 2k − 1) 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 input before transforming it by multiplying elementwise by a weight vector, then weighting the result by another vector.[5] The Irrational base discrete weighted transform is a special case of this.
Properties
Most of the important attributes of the complex DFT, including the inverse transform, the convolution theorem, and most fast Fourier transform (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, considering any field with a primitive nth root of unity as an algebra over the extension field [math]\displaystyle{ \mathbf{F}_{1^n}. }[/math][clarification needed]
In particular, the applicability of [math]\displaystyle{ O(n \log n) }[/math] fast Fourier transform algorithms to compute the NTT, combined with the convolution theorem, mean that the number-theoretic transform gives an efficient way to compute exact convolutions of integer sequences. While the complex DFT can perform the same task, it is susceptible to round-off error in finite-precision floating point 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 computes the DFT), it is often desirable that the transform length is also highly composite, e.g., a power of two. However, there are specialized fast Fourier transform algorithms for finite fields, such as Wang and Zhu's algorithm,[6] that are efficient regardless of whether the transform length factors.
See also
- Discrete Fourier transform (complex)
- Gauss sum
- Convolution
- Least-squares spectral analysis
- Multiplication algorithm
References
- ↑ 1.0 1.1 1.2 Martin Fürer, "Faster Integer Multiplication", STOC 2007 Proceedings, pp. 57–66. Section 2: The Discrete Fourier Transform.
- ↑ R. Lidl and G. Pilz. Applied Abstract Algebra, 2nd edition. Wiley, 1999, pp. 217–219.
- ↑ Agarwal, R.; Burrus, C. (April 1974). "Fast Convolution using fermat number transforms with applications to digital filtering" (in en). IEEE Transactions on Acoustics, Speech, and Signal Processing 22 (2): 87–97. doi:10.1109/TASSP.1974.1162555. ISSN 0096-3518. http://ieeexplore.ieee.org/document/1162555/.
- ↑ Rader, C.M. (December 1972). "Discrete Convolutions via Mersenne Transrorms". IEEE Transactions on Computers C-21 (12): 1269–1273. doi:10.1109/T-C.1972.223497. ISSN 0018-9340. http://ieeexplore.ieee.org/document/1672090/.
- ↑ Crandall, Richard; Fagin, Barry (1994), "Discrete weighted transforms and large-integer arithmetic", Mathematics of Computation 62 (205): 305–324, doi:10.2307/2153411, http://www.faginfamily.net/barry/Papers/Discrete%20Weighted%20Transforms.pdf
- ↑ Yao Wang 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
External links