# 2-D IFFT

Compute 2-D inverse fast Fourier transform (IFFT)

• Libraries:
Computer Vision Toolbox / Transforms

## Description

The 2-D IFFT block computes the inverse discrete Fourier transform (IDFT) of a two-dimensional input matrix using the fast Fourier transform (FFT) algorithm. The equation for the 2-D IDFT f(x, y) of an M-by-N input matrix, F(m, n), is:

`$f\left(x,y\right)=\frac{1}{MN}\sum _{m=0}^{M-1}\sum _{n=0}^{N-1}F\left(m,n\right){e}^{j\frac{2\pi mx}{M}}{e}^{j\frac{2\pi ny}{N}},$`

where $0\le x\le M-1$ and $0\le y\le N-1$.

The block supports FFT implementation based on the FFTW library and an implementation based on a collection of Radix-2 algorithms. You can either manually select one of these implementations or let the block select one automatically.

## Ports

### Input

expand all

Input data, specified as a vector or matrix of intensity values.

Data Types: `single` | `double` | `int8` | `int16` | `int32` | `uint8` | `uint16` | `uint32` | `fixed point`
Complex Number Support: Yes

### Output

expand all

Output data containing the 2-D IFFT of the input, returned as a vector or matrix. The size and data type of the output are the same as those of the input.

Data Types: `single` | `double` | `int8` | `int16` | `int32` | `uint8` | `uint16` | `uint32` | `fixed point`
Complex Number Support: Yes

## Parameters

expand all

### Main

Specify the type of implementation to compute the FFT as one of these options:

• `FFTW` — Select this option to use to support an arbitrary-length input signal. The block restricts generated code with the `FFTW` implementation to host computers capable of running MATLAB®.

• `Radix-2` — Select this option to support bit-reversed processing, fixed and floating-point data, or portable C-code generation using Simulink Coder. The dimensions of the input matrix, M and N, must be powers of two. To work with other input sizes, use the Image Pad block to pad or truncate these dimensions to powers of two, or, if possible, choose the `FFTW` implementation. For more information about the algorithms used by the `Radix-2` mode, see Radix-2 Implementation.

• `Auto` — Select this option to let the block choose the FFT implementation. For non-power-of-two transform lengths, the block restricts generated code to MATLAB host computers.

Specify whether the input to the block is in bit-reversed order or linear order. Select this parameter when you specify the input in bit-reversed order. Otherwise, clear this parameter. The block yields invalid output when you do not set this parameter correctly. For more information on the bit-reversed order of input, see Bit-Reversed Order.

#### Dependencies

To enable this parameter, set the FFT implementation parameter to `Auto` or `Radix-2`.

Select this parameter to specify that the block input is conjugate symmetric, and you want real-valued outputs. Otherwise, clear this parameter.

The 2-D FFT block yields conjugate symmetric output when you input real-valued data. Taking the 2-D IFFT of a conjugate symmetric input matrix produces real-valued output. Therefore, if the input to the 2-D IFFT block is conjugate symmetric, and you select this parameter, the block produces real-valued outputs. When you select this parameter, the block optimizes its computation method. You cannot select this parameter for fixed-point.

If you specify conjugate symmetric input data and do not select this parameter, the block outputs complex-valued data with small imaginary parts. The block outputs invalid data if you select this parameter with input data that is not conjugate symmetric input data.

Select this parameter to compute the scaled IFFT, which divides the output by the product of the dimension lengths of the FFT input dimension, as shown in this equation.

`$f\left(x,y\right)=\frac{1}{MN}\sum _{m=0}^{M-1}\sum _{n=0}^{N-1}F\left(m,n\right){e}^{j\frac{2\pi mx}{M}}{e}^{j\frac{2\pi ny}{N}},$`

where $0\le x\le M-1$ and $0\le y\le N-1$.

When you clear this parameter, the block computes the unscaled version of the IFFT, as shown in this equation.

`$f\left(x,y\right)=\sum _{m=0}^{M-1}\sum _{n=0}^{N-1}F\left(m,n\right){e}^{j\frac{2\pi mx}{M}}{e}^{j\frac{2\pi ny}{N}}$`

### Data Types

For details on the fixed-point block parameters, see Specify Fixed-Point Attributes for Blocks (DSP System Toolbox).

Select this parameter to prevent the fixed-point tools from overriding the data types you specify in this block. For more information, see Lock the Output Data Type Setting (Fixed-Point Designer).

## Block Characteristics

 Data Types `double` | `fixed point` | `integer` | `single` Multidimensional Signals `no` Variable-Size Signals `yes`