ifft2 - 2-D inverse fast Fourier transform - MATLAB (original) (raw)

2-D inverse fast Fourier transform

Syntax

Description

X = ifft2([Y](#bvjz37f-Y),[m](#bvjz37f-m),[n](#bvjz37f-n)) truncates Y or pads Y with trailing zeros to form an m-by-n matrix before computing the inverse transform. X is also m-by-n. If Y is a multidimensional array, then ifft2 shapes the first two dimensions of Y according to m and n.

example

X = ifft2(___,[symflag](#bvjz37f-symflag)) specifies the symmetry of Y in addition to any of the input argument combinations in previous syntaxes. For example,ifft2(Y,'symmetric') treats Y as conjugate symmetric.

example

Examples

collapse all

You can use the ifft2 function to convert 2-D signals sampled in frequency to signals sampled in time or space. The ifft2 function also allows you to control the size of the transform.

Create a 3-by-3 matrix and compute its Fourier transform.

X = 3×3

 8     1     6
 3     5     7
 4     9     2

Y = 3×3 complex

45.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 13.5000 + 7.7942i 0.0000 - 5.1962i 0.0000 - 0.0000i 0.0000 + 5.1962i 13.5000 - 7.7942i

Take the inverse transform of Y, which is the same as the original matrix X, up to round-off error.

ans = 3×3

8.0000    1.0000    6.0000
3.0000    5.0000    7.0000
4.0000    9.0000    2.0000

Pad both dimensions of Y with trailing zeros so that the transform has size 8-by-8.

Z = ifft2(Y,8,8); size(Z)

For nearly conjugate symmetric matrices, you can compute the inverse Fourier transform faster by specifying the 'symmetric' option, which also ensures that the output is real.

Compute the 2-D inverse Fourier transform of a nearly conjugate symmetric matrix.

Y = [3+1e-15*i 5; 5 3]; X = ifft2(Y,'symmetric')

Input Arguments

collapse all

Input array, specified as a matrix or a multidimensional array. If Y is of type single, then ifft2 natively computes in single precision, and X is also of type single. Otherwise, X is returned as type double.

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

Number of inverse transform rows, specified as a positive integer scalar.

Data Types: double | single | int8 | int16 | int32 | uint8 | uint16 | uint32 | logical

Number of inverse transform columns, specified as a positive integer scalar.

Data Types: double | single | int8 | int16 | int32 | uint8 | uint16 | uint32 | logical

Symmetry type, specified as 'nonsymmetric' or'symmetric'. When Y is not exactly conjugate symmetric due to round-off error,ifft2(Y,'symmetric') treats Y as if it were conjugate symmetric by ignoring the second half of its elements (that are in the negative frequency spectrum). For more information on conjugate symmetry, see Algorithms.

More About

collapse all

This formula defines the discrete inverse Fourier transform X of an _m_-by-n matrix Y:

ωm and ωn are complex roots of unity:

i is the imaginary unit. p runs from 1 to m and q runs from 1 to n.

Algorithms

Extended Capabilities

expand all

Usage notes and limitations:

Usage notes and limitations:

The ifft2 function supports GPU array input with these usage notes and limitations:

For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).

Version History

Introduced before R2006a