# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English version of the page.

# vision.FFT System object

Two-dimensional discrete Fourier transform

## Description

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.

## Construction

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

### 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`.

## Properties

 `FFTImplementation` 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` `BitReversedOutput` 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` `Normalize` 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

## Methods

 step Compute 2D discrete Fourier transform of input
Common to All System Objects
`clone`

Create System object with same property values

`getNumInputs`

Expected number of inputs to a System object

`getNumOutputs`

Expected number of outputs of a System object

`isLocked`

Check locked states of a System object (logical)

`release`

Allow System object property value changes

## Examples

expand all

Create the FFT object

`fftObj = vision.FFT; `

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

Compute the FFT.

`J = step(fftObj, I); `

Shift zero-frequency components to the center of the 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');```

## References

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