ifftshift

paddle.fft. ifftshift ( x, axes=None, name=None ) [source]

The inverse of fftshift. Although the even length ‘x’ is the same, the function of the odd length ‘x’ is different. An example.

Parameters
  • n (int) – Dimension inputed.

  • axes (int|tuple, optional) – The axis on which to move. The default is none, which moves all axes. Default is None.

  • 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

Tensor. The shifted tensor.

Examples

>>> import paddle

>>> fftfreq_xp = paddle.fft.fftfreq(5, d=0.3)
>>> print(fftfreq_xp)
Tensor(shape=[5], dtype=float32, place=Place(cpu), stop_gradient=True,
[0., 0.66666669, 1.33333337, -1.33333337, -0.66666669])

>>> res = paddle.fft.ifftshift(fftfreq_xp)
>>> print(res)
Tensor(shape=[5], dtype=float32, place=Place(cpu), stop_gradient=True,
[1.33333337, -1.33333337, -0.66666669, 0., 0.66666669])