In mathematics, the discrete Fourier transform (DFT) is a discrete version of the Fourier transform that converts a finite sequence of numbers into another sequence of the same length, representing the amplitude and phase of different frequency components. In this way, it changes data from a description in terms of sampled values to a description in terms of oscillations. The inverse discrete Fourier transform reverses this process and recovers the original sequence.

For data sampled at equally spaced points, the DFT can be understood more precisely as converting between sample values and the coefficients of a trigonometric polynomial that interpolates those values. It is therefore a basic tool for numerical work with smooth periodic functions, which can often be approximated well by trigonometric polynomials. In practice, the DFT is usually computed by efficient fast Fourier transform (FFT) algorithms.

The DFT is used in many practical applications of Fourier analysis. In digital signal processing, the input is often a sampled quantity or signal that varies over time, such as the pressure of a sound wave, a radio signal, or daily temperature readings, sampled over a finite time interval (often defined by a window function). In image processing, the samples can be the values of pixels along a row or column of a raster image. The DFT is also used to efficiently solve partial differential equations, and to perform other operations such as convolutions or multiplying large integers.

Since the DFT deals with a finite amount of data, it can be implemented in computers by numerical algorithms or even dedicated hardware. These implementations usually employ efficient fast Fourier transform (FFT) algorithms; so much so that the terms "FFT" and "DFT" are often used interchangeably. Prior to its current usage, the "FFT" initialism may have also been used for the ambiguous term "finite Fourier transform".

Definition The discrete Fourier transform transforms a sequence of N complex numbers into another sequence of complex numbers, which is defined by:

The transform is sometimes denoted by the symbol , as in or or .

As a linear transformation on a finite-dimensional vector space, the DFT expression can also be written in terms of a DFT matrix. When scaled appropriately, it becomes a unitary matrix, and the DFT can thus be viewed as a transformation from one orthonormal basis to another.

The inverse transform is given by:

is also -periodic (in index ). In , each is a complex number whose polar coordinates are the amplitude and phase of a complex sinusoidal component of the function . (See Discrete Fourier series.) The sinusoid's frequency is cycles per samples.

The normalization factor multiplying the DFT and inverse DFT (IDFT), here 1 and , and the signs of the exponents are the most common conventions. The only actual requirements of these conventions are that the DFT and IDFT have opposite-sign exponents and that the product of their normalization factors be An uncommon normalization of for both the DFT and IDFT makes the transform-pair unitary.

can also be evaluated outside the domain , and that extended sequence is -periodic. Accordingly, other sequences of indices are sometimes used, such as (if is even) and (if is odd), which amounts to swapping the left and right halves of the result of the transform.

DFT including sampling interval Using the standard definition of the DFT omits the sampling interval (or sampling distance) in cases where the index corresponds to time via .

To relate the DFT coefficients to the continuous Fourier transform of sampled data, the sampling interval can be included explicitly as

Most software libraries compute the unscaled DFT coefficients , including their corresponding FFT implementations. The scaled coefficients can therefore be obtained as .

The corresponding inverse transform then becomes:

Where .

Using the inverse discrete Fourier transform as implemented in most software libraries, this can equivalently be written as:

When applying the DFT to physical data, the sampling interval (or equivalently ) is an essential part of the signal definition. Including the sampling interval ensures correct amplitude, energy, and frequency interpretation, particularly when combining or comparing data from different sources.

Interpretations

The DFT can be regarded as transforming 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-valued function of frequency. The interval at which the DTFT is sampled is the reciprocal of the duration of the input sequence. An inverse DFT (IDFT) is a Fourier series, using the DTFT samples as coefficients of complex sinusoids at the corresponding DTFT frequencies. It has the same sample-values as the original input sequence. The DFT is therefore said to be a frequency domain representation of the original input sequence. If the original sequence spans all the non-zero values of a function, its DTFT is continuous (and periodic), and the DFT provides discrete samples of one cycle. If the original sequence is one cycle of a periodic function, the DFT provides all the non-zero values of one DTFT cycle.

can be interpreted or derived in various ways, for example:

Example

This example demonstrates how to apply the DFT to a sequence of length and the input vector

Calculating the DFT of using

results in

Properties

Linearity The DFT is a linear transform, i.e. if and , then for any complex numbers :

Time and frequency reversal Reversing the time (i.e. replacing by ) in corresponds to reversing the frequency (i.e. by ). Mathematically, if represents the vector x then

if then

Conjugation in time If then .

Real and imaginary part This table shows some mathematical operations on in the time domain and the corresponding effects on its DFT in the frequency domain.

Property Time domain Frequency domain Real part in time Imaginary part in time Real part in frequency Imaginary part in frequency

Orthogonality The vectors , for , form an orthogonal basis over the set of N-dimensional complex vectors:

where is the Kronecker delta. (In the last step, the summation is trivial if , where it is and otherwise is a geometric series that can be explicitly summed to obtain zero.) This orthogonality condition can be used to derive the formula for the IDFT from the definition of the DFT, and is equivalent to the unitarity property below.

The Plancherel theorem and Parseval's theorem If and are the DFTs of and respectively then Parseval's theorem states:

where the star denotes complex conjugation. The Plancherel theorem is a special case of Parseval's theorem and states:

These theorems are also equivalent to the unitary condition below.

Periodicity The periodicity can be shown directly from the definition:

Similarly, it can be shown that the IDFT formula leads to a periodic extension of .

Shift theorem Multiplying by a linear phase for some integer m corresponds to a circular shift of the output : is replaced by , where the subscript is interpreted modulo N (i.e., periodically). Similarly, a circular shift of the input corresponds to multiplying the output by a linear phase. Mathematically, if represents the vector x then

if then and

Circular convolution theorem and cross-correlation theorem

The convolution theorem for the discrete-time Fourier transform (DTFT) indicates that a convolution of two sequences can be obtained as the inverse transform of the product of the individual transforms. An important simplification occurs when one of sequences is N-periodic, denoted here by because is non-zero at only discrete frequencies (see ), and therefore so is its product with the continuous function That leads to a considerable simplification of the inverse transform.

where is a periodic summation of the sequence:

Customarily, the DFT and inverse DFT summations are taken over the domain . Defining those DFTs as and , the result is:

In practice, the sequence is usually length N or less, and is a periodic extension of an N-length -sequence, which can also be expressed as a circular function:

Then the convolution can be written as:

which gives rise to the interpretation as a circular convolution of and It is often used to efficiently compute their linear convolution. (see Circular convolution, Fast convolution algorithms, and Overlap-save)

Similarly, the cross-correlation of and is given by:

Uniqueness of the Discrete Fourier Transform

As seen above, the discrete Fourier transform has the fundamental property of carrying convolution into componentwise product. A natural question is whether it is the only one with this ability. It has been shown that any linear transform that turns convolution into pointwise product is the DFT up to a permutation of coefficients. Since the number of permutations of n elements equals n!, there exist exactly n! linear and invertible maps with the same fundamental property as the DFT with respect to convolution.

Convolution theorem duality

It can also be shown that:

which is the circular convolution of and .

Trigonometric interpolation polynomial The trigonometric interpolation polynomial

where the coefficients Xk are given by the DFT of xn above, satisfies the interpolation property for .

For even N, notice that the Nyquist component is handled specially.

This interpolation is not unique: aliasing implies that one could add N to any of the complex-sinusoid frequencies (e.g. changing to ) without changing the interpolation property, but giving different values in between the points. The choice above, however, is typical because it has two useful properties. First, it consists of sinusoids whose frequencies have the smallest possible magnitudes: the interpolation is bandlimited. Second, if the are real numbers, then is real as well.

In contrast, the most obvious trigonometric interpolation polynomial is the one in which the frequencies range from 0 to (instead of roughly to as above), similar to the inverse DFT formula. This interpolation does not minimize the slope, and is not generally real-valued for real ; its use is a common mistake.

The unitary DFT Another way of looking at the DFT is to note that in the above discussion, the DFT can be expressed as the DFT matrix, a Vandermonde matrix, introduced by Sylvester in 1867,

where is a primitive Nth root of unity.

For example, in the case when , , and

(which is a Hadamard matrix) or when as in the above, , and

The inverse transform is then given by the inverse of the above matrix,

With unitary normalization constants , the DFT becomes a unitary transformation, defined by a unitary matrix:

where is the determinant function. The determinant is the product of the eigenvalues, which are always or as described below. In a real vector space, a unitary transformation can be thought of as simply a rigid rotation of the coordinate system, and all of the properties of a rigid rotation can be found in the unitary DFT.

The orthogonality of the DFT is now expressed as an orthonormality condition (which arises in many areas of mathematics as described in root of unity):

If X is defined as the unitary DFT of the vector x, then

and the Parseval's theorem is expressed as

If we view the DFT as just a coordinate transformation which simply specifies the components of a vector in a new coordinate system, then the above is just the statement that the dot product of two vectors is preserved under a unitary DFT transformation. For the special case , this implies that the length of a vector is preserved as well — this is just Plancherel theorem,

A consequence of the circular convolution theorem is that the DFT matrix diagonalizes any circulant matrix.

Expressing the inverse DFT in terms of the DFT