Signal processing
Discrete Fourier transform
signal.dftAlso called dft, fft, fourier transform, discrete fourier transform
The N complex Fourier coefficients of N samples, unnormalized, with the negative exponent in the forward direction. The inverse is xn = (1/N) Σ Xk e2πikn/N; the fast Fourier transform computes the same values in O(N log N) operations.
Notation
the samples x0 … xN−1
x ∈ ℝN
number of samples
Size, at least 1
Result: the Fourier coefficients X0 … XN−1
vector
Worked examples
Each result is solved exactly and confirmed by two independent computations.
Given
Result
Given
Result
Given
Result
Given
Result
Common mistakes
Uses the positive exponent
e+2πikn/N is the inverse transform without its 1/N; for real input every coefficient comes out as the complex conjugate of the right one.
Fix: Use e−2πikn/N in the forward transform.
Divides the forward transform by N
Every coefficient is 1/N of the unnormalized value; that convention moves the 1/N from the inverse into the forward transform.
Fix: Leave the forward sum unscaled and put 1/N on the inverse, or state the convention.
Source
Cooley and Tukey 1965
Cooley, James W.; Tukey, John W. An Algorithm for the Machine Calculation of Complex Fourier Series. Mathematics of Computation 19(90): 297-301, 1965. doi:10.1090/S0025-5718-1965-0178586-1