Fourier methods · inversion
Inverse Discrete Fourier Transform (IDFT Matrix)
The inverse discrete Fourier transform turns N spectral values back into the N time samples they came from. As a formula it is a sum of N complex exponentials, and as a matrix it is the conjugate of the DFT matrix divided by N. Both views give the same numbers, and both are worth knowing, because the formula explains what the transform means while the idft matrix explains why it is exactly invertible. Both directions of the transform are everyday tools in signal processing.
Formula and matrix
For a spectrum X(0), …, X(N − 1) the samples are
x(n) = (1/N) ∑k=0..N−1 X(k) · e+j2πkn/N
The forward transform uses the exponent with a minus sign and no 1/N. Write W = e−j2π/N. The forward matrix F has entry Wkn in row k and column n, and the inverse matrix has entry W−kn/N. Since W−1 is the complex conjugate of W, the inverse is conj(F)/N.
Why does that undo the forward step? Multiplying the two matrices gives entries (1/N) ∑ W(m−n)k, a geometric sum over k that equals 1 when m = n and 0 otherwise. The columns of F are orthogonal, each with squared length N, so F · conj(F) = N · I.
The 4-point matrix
For N = 4 the exponent step is W = e−jπ/2 = −j, and the powers of W repeat with period 4: 1, −j, −1, j. Row k of F lists Wkn for n = 0 to 3:
| row | n=0 | n=1 | n=2 | n=3 |
|---|---|---|---|---|
| k=0 | 1 | 1 | 1 | 1 |
| k=1 | 1 | −j | −1 | j |
| k=2 | 1 | −1 | 1 | −1 |
| k=3 | 1 | j | −1 | −j |
The inverse is the same table with every j replaced by −j, all multiplied by 1/4.
Worked example
Start with x = [1, 2, 3, 4]. Multiplying by F gives X = [10, −2 + 2j, −2, −2 − 2j]. Each entry follows from the table: X(1) = 1 + 2(−j) + 3(−1) + 4(j) = −2 + 2j, and X(2) = 1 − 2 + 3 − 4 = −2.
Now invert. For n = 1 the exponent factors are jk, giving 1, j, −1, −j for k = 0 to 3:
x(1) = ¼ [10 + (−2 + 2j)(j) + (−2)(−1) + (−2 − 2j)(−j)]
The three products are −2j − 2, then +2, then 2j − 2. Adding them to 10 yields 8, and 8/4 = 2, the second sample. For n = 2 the factors are 1, −1, 1, −1 and the sum is 10 + 2 − 2j − 2 + 2 + 2j = 12, so x(2) = 3. The other two samples follow the same way and the original vector returns.
Where the 1/N goes
Different libraries place the 1/N scaling differently. Some put it in the inverse, as above. Some split it as 1/√N on both directions so the transform is unitary and preserves energy. A third group omits it from both and leaves the user to divide. The mismatch causes amplitude errors that are easy to miss: a spectrum round-trips cleanly only when the forward and inverse conventions match. A quick test is to transform a vector of ones. A constant signal of 1s with the forward-only convention gives X(0) = N, and the inverse must bring it back to 1.
Practical notes
Forming the matrix costs N² entries, fine for short vectors and wasteful for long ones. The same result comes from the inverse fast Fourier transform at a cost proportional to N log N. For a real signal, the spectrum has conjugate symmetry, X(N − k) = conj(X(k)), and the result of the inversion should be real up to rounding error of the order of machine precision. If a visibly nonzero imaginary part appears, the symmetry was broken somewhere, often by a reordering such as fftshift applied on one side only.
The related convolution of vectors is where the transform pair earns its keep: spectra multiply where signals convolve.