MATLAB LanguageFourier Transforms and Inverse Fourier Transforms


Syntax

  1. Y = fft(X) %computes the FFT of Vector or Matrix X using a default Transform Length of 256 (to be confirmed for version)

  2. Y = fft(X,n) %computes the FFT of X using n as Transform Length, n must be a 2-power based number. If the length of X is less than n, then Matlab will automatically pad X with zeros such that length(X) = n

  3. Y = fft(X,n,dim) %computes the FFT of X using n as Transform Length along dimension dim (can be 1 or 2 for horizontal or vertical respectively)

  4. Y = fft2(X) % Compute the 2D FFT of X

  5. Y = fftn(X, dim) % Compute the dim-dimensional FFT of X, with respect to the vector of dimensions dim.

  6. y = ifft(X) %computes the Inverse of FFT of X (which is a matrix/vector of numbers) using the default 256 Transform Length

  7. y = ifft(X,n) %computes the IFFT of X using n as Transform Length

  8. y = ifft(X,n,dim) %computes the IFFT of X using n as Transform Length over dimension dim (can be 1 or 2 for horizontal or vertical respectively)

  9. y = ifft(X,n,dim,'symmetric') %The Symmetric option causes ifft to treat X as conjugate symmetric along the active dimension. This option is useful when X is not exactly conjugate symmetric, merely because of round-off error.

  10. y = ifft2(X) % Compute the inverse 2D ft of X

  11. y= ifftn(X,dim) %Compute the inverse dim-dimensional fft of X.

Parameters

ParameterDescription
Xthis is your input Time-Domain signal, it should be a vector of numerics.
nthis is the NFFT parameter known as Transform Length, think of it as resolution of your FFT result, it MUST be a number that is a power of 2 (i.e. 64,128,256...2^N)
dimthis is the dimension you want to compute FFT on, use 1 if you want to compute your FFT in the horizontal direction and 2 if you want to compute your FFT in the vertical direction - Note this parameter is usually left blank, as the function is capable of detecting the direction of your vector.

Remarks

Matlab FFT is a very parallelized process capable of handling large amounts of data. It can also use the GPU to huge advantage.

ifft(fft(X)) = X

The above statement is true if rounding errors are omitted.