Main Content


2-D inverse fast Fourier transform



X = ifft2(Y) returns the two-dimensional discrete inverse Fourier transform of a matrix using a fast Fourier transform algorithm. If Y is a multidimensional array, then ifft2 takes the 2-D inverse transform of each dimension higher than 2. The output X is the same size as Y.


X = ifft2(Y,m,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.


X = ifft2(___,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.


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 = magic(3)
X = 3×3

     8     1     6
     3     5     7
     4     9     2

Y = fft2(X)
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);
ans = 1×2

     8     8

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')
X = 2×2

     4     0
     0    -1

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. For more information on conjugate symmetry, see Algorithms.

More About

collapse all

2-D Inverse Fourier Transform

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.


  • The ifft2 function tests whether the matrix Y is conjugate symmetric. If Y is conjugate symmetric, then the inverse transform computation is faster and the output is real.

    A function g(a,b) is conjugate symmetric if g(a,b)=g*(a,b). However, the fast Fourier transform of a 2-D time-domain signal has one half of its spectrum in positive frequencies and the other half in negative frequencies, with the first row and column reserved for the zero frequencies. For this reason, a matrix Y is conjugate symmetric when all of these conditions are true:

    • Y(1,2:end) is conjugate symmetric, or Y(1,2:end) = conj(Y(1,end:-1:2))

    • Y(2:end,1) is conjugate symmetric, or Y(2:end,1) = conj(Y(end:-1:2,1))

    • Y(2:end,2:end) is conjugate centrosymmetric, or Y(2:end,2:end) = conj(Y(end:-1:2,end:-1:2))

Extended Capabilities

Version History

Introduced before R2006a

See Also

| | | |