Two-dimensional discrete Fourier transform
The vision.FFT object computes the 2D discrete Fourier transform (DFT) of a two-dimensional input matrix.
fftObj = vision.FFT returns a 2D FFT object, fftObj, that computes the fast Fourier transform of a two-dimensional input.
fftObj = vision.FFT(Name,Value) configures the System object properties, specified as one or more name-value pair arguments. Unspecified properties have default values.
Define and set up your FFT object using the constructor.
Call the step method with the input image, I and the FFT object, fftObj. See the syntax below for using the step method.
J = step(fftObj,I) computes the 2-D FFT, J, of an M-by-N input matrix I, where M and N specify the dimensions of the input. The dimensions M and N must be positive integer powers of two when any of the following are true:
|The input is a fixed-point data type|
|You set the BitReversedOutput property to true.|
|You set the FFTImplementation property to Radix-2.|
Specify the implementation used for the FFT as one of Auto | Radix-2 | FFTW. When you set this property to Radix-2, the FFT length must be a power of two.
Output in bit-reversed order relative to input
Designates the order of output channel elements relative to the order of input elements. Set this property to true to output the frequency indices in bit-reversed order.
Divide butterfly outputs by two
Set this property to true if the output of the FFT should be divided by the FFT length. This option is useful when you want the output of the FFT to stay in the same amplitude range as its input. This is particularly useful when working with fixed-point data types.
Default: false with no scaling
|clone||Create FFT object with same property values|
|getNumInputs||Number of expected inputs to step method|
|getNumOutputs||Number of outputs from step method|
|isLocked||Locked status for input attributes and nontunable properties|
|release||Allow property value and input characteristics changes|
|step||Compute 2D discrete Fourier transform of input|
Create the FFT object.
fftObj = vision.FFT;
Read the image.
I = im2single(imread('pout.tif'));
Compute the FFT.
J = step(fftObj, I);
Shift zero-frequency components to the center of spectrum.
J_shifted = fftshift(J);
Display original image and visualize its FFT magnitude response.
figure; imshow(I); title('Input image, I'); figure; imshow(log(max(abs(J_shifted), 1e-6)),), colormap(jet(64)); title('Magnitude of the FFT of I');
 FFTW (http://www.fftw.org)
 Frigo, M. and S. G. Johnson, "FFTW: An Adaptive Software Architecture for the FFT,"Proceedings of the International Conference on Acoustics, Speech, and Signal Processing, Vol. 3, 1998, pp. 1381-1384.