Functions > Transforms and Filters > Discrete Fourier Transform of Data
  
Discrete Fourier Transform of Data
dft(A), idft(Z)—Return the forward/inverse Fourier Transform of a complex-valued vector or matrix.
If the input to dft is a vector V of length r, then:
The output of dft(V) is a vector Z of length r
The output of idft(Z) is a vector of length r
If the input to dft is a matrix M of r rows and c columns, then:
The output of dft(M) is a matrix P of r rows and c columns
The output of idft(P) is a matrix of r rows and c columns.
dftr(B), idftr(Z)—Return the forward/inverse Fourier Transform of a real-valued vector or matrix.
If the input to dftr is a vector V of length r, then:
The output of dftr(V) is a vector Z of length L, where L=floor(r/2)+1. The elements of Z are identical to the first L elements of the output of dft(V).
The output of idftr(Z) is a vector of length r=2(L-1).
If the input to dftr is a matrix M with r rows and c columns, then:
The output of dftr(M) is a matrix P with r rows and L columns, where L=floor(c/2)+1. The elements of P are identical to the first L columns of the output of dft(M)
The output of idftr(P) is a matrix of r rows and c=2(L-1) columns.
Arguments
A is a complex-valued vector or matrix of any size
B is a real-valued vector or matrix. Any imaginary part is ignored. If B is a vector, then the number of rows must be a multiple of 2. If B is a matrix, then the number of columns must be a multiple of 2
For both A and B, the data must have compatible units
Fourier Transform of Vectors
If A is a vector of size m, then the uth element of the one dimensional (1D) forward transform of vector A, is given by Zu as follows:
Where:
m is the number of rows and u is defined as:
i is the imaginary unit and wm is defined as:
Evaluating Z in the above definition is equivalent to applying the dft function to vector A.
If Z is a vector of size m, then the uth element of the one dimensional (1D) inverse transform of vector Z, is given by Au as follows:
Where:
m, u, and wm are defined above.
Evaluating A in the above definition is equivalent to applying the idft function to vector Z.
Fourier Transform of Matrices
If A is a matrix of size mxn, then the (u,v)th element of the two dimensional (2D) forward transform of matrix A is given by Zu,v as follows:
Where:
m, u and wm are defined above.
n is the number of columns and v is defined as:
i is the imaginary unit and wn is defined as:
Evaluating Z in the above definition is equivalent to applying the dft function to matrix A.
If Z is a matrix of size mxn, then the (u,v)th element of the two dimensional (2D) inverse transform of matrix A, is given by Au,v as follows:
Where:
m, n, u, v, wm and wn are defined above.
Evaluating A in the above definition is equivalent to applying the idft function to matrix Z.
Additional Information
Fourier functions run faster when the number of vector rows and matrix columns is a power of 2.
The new dft/idft functions replace the functionality of the deprecated cfft/icfft and CFFT/ICFFT functions and offer significant performance improvement, particularly for larger data sets and cases where the size is not a power of 2.
The new dftr/idftr functions replace the functionality of the deprecated fft/ifft and FFT/IFFT functions.
Function dftr operates on real vectors whose length is an even number, and on matrices with an even number of columns.
Functions fft/FFT only operate on real vectors whose length is a power of 2.
Functions ifft/IFFT have only half the input vector length plus one, or 2k-1+1, where k is an integer > 1. The other half, which is the conjugate of the first part with the order reversed, must be reconstructed manually. Functions dft/idft return the full result back.
Functions dft/idft differ from the deprecated fft/ifft, FFT/IFFT and cfft/icfft, CFFT/ICFFT in both the scaling factor and the exponent sign.
For the forward transforms, the differences are:
dft/dftr
fft/cfft
FFT/CFFT
Scaling Factor
1
1/√m√n
1/m.n
Exponent Sign
Negative
Positive
Negative
For the inverse transforms, the differences are:
idft/idftr
ifft/icfft
IFFT/ICFFT
Scaling Factor
1/m.n
1/√m√n
1
Exponent Sign
Positive
Negative
Positive
When calculating the scaling factor for functions that operate on vectors only (1D cases), assume that n=1.