ihfft2

paddle.fft. ihfft2 ( x, s=None, axes=(- 2, - 1), norm='backward', name=None ) [source]

Compute the two dimensional inverse FFT of a real spectrum.

This is really ihfftn with different defaults. For more details see ihfftn.

Parameters
  • x (Tensor) – Input tensor.

  • s (Sequence[int], optional) – Shape of the real input to the inverse FFT.

  • axes (Sequance[int], optional) – The axes over which to compute the inverse fft. Default is the last two axes.

  • norm (str, optional) – {“backward”, “ortho”, “forward”}. Default is “backward”.

  • name (str, optional) – The default value is None. Normally there is no need for user to set this property. For more information, please refer to Name .

Returns

The result of the inverse hermitian 2-D FFT.

Return type

out(Tensor)

Examples

import paddle

arr = paddle.arange(5, dtype="float64")
x = paddle.meshgrid(arr, arr)[0]
print(x)
# Tensor(shape=[5, 5], dtype=float64, place=Place(gpu:0), stop_gradient=True,
#        [[0., 0., 0., 0., 0.],
#         [1., 1., 1., 1., 1.],
#         [2., 2., 2., 2., 2.],
#         [3., 3., 3., 3., 3.],
#         [4., 4., 4., 4., 4.]])

ihfft2_xp = paddle.fft.ihfft2(x)
print(ihfft2_xp.numpy())
# [[ 2. +0.j          0. +0.j          0. +0.j        ]
#  [-0.5-0.68819096j  0. +0.j          0. +0.j        ]
#  [-0.5-0.16245985j  0. +0.j          0. +0.j        ]
#  [-0.5+0.16245985j  0. +0.j          0. +0.j        ]
#  [-0.5+0.68819096j  0. +0.j          0. +0.j        ]]