Discrete Fourier transform matrix
In practice, it is more efficient to compute the discrete Fourier transform with the FFT than with the DFT matrix. The FFT also uses less memory. The two procedures give the same result.
x = 1:256; y1 = fft(x); n = length(x); y2 = x*dftmtx(n); norm(y1-y2)
ans = 1.8295e-09
n— Discrete Fourier transform length
Discrete Fourier transform length, specified as an integer.
a— Discrete Fourier transform matrix
Discrete Fourier transform matrix, returned as a matrix.
A discrete Fourier transform matrix is a complex
matrix whose matrix product with a vector computes the discrete Fourier transform of the
dftmtx takes the FFT of the identity matrix to generate the
For a column vector
y = dftmtx(n)*x
y = fft(x,n). The inverse discrete Fourier transform matrix is
ainv = conj(dftmtx(n))/n