This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

vision.FFT System object

Package: vision

Two-dimensional discrete Fourier transform


The vision.FFT object computes the 2D discrete Fourier transform (DFT) of a two-dimensional input matrix.

    Note:   Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.


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.

Code Generation Support
Supports MATLAB® Function block: Yes
System Objects in MATLAB Code Generation.
Code Generation Support, Usage Notes, and Limitations.

To compute FFT:

  1. Define and set up your FFT object using the constructor.

  2. 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.



FFT implementation

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.

Default: Auto


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.

Default: false


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

 Fixed-Point Properties


cloneCreate FFT object with same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs from step method
isLockedLocked status for input attributes and nontunable properties
release Allow property value and input characteristics changes
stepCompute 2D discrete Fourier transform of input


expand all

Visualize original image and its FFT magnitude response.

Create the FFT object.

fftObj = vision.FFT;

Read the image.

I = im2single(imread('pout.tif'));

Compute the FFT.

J = 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');
imshow(log(max(abs(J_shifted), 1e-6)),[]),colormap(jet(64));
title('Magnitude of the FFT of I');


[2] 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.

Introduced in R2012a

Was this topic helpful?