ihfft

paddle.fft. ihfft ( x, n=None, axis=- 1, norm='backward', name=None ) [source]

The inverse FFT of a signal that has Hermitian symmetry.

This function computes the one dimensional n-point inverse FFT of a signal that has Hermitian symmetry by means of an efficient algorithm called the Fast Fourier Transform (FFT).

When the DFT is computed for purely real input, the output is Hermitian-symmetric. This function does not compute the negative frequency terms, and the length of the transformed axis of the output is therefore n//2 + 1.

Parameters
  • x (Tensor) – Input tensor.

  • n (int, optional) – The number of points along transformation axis in the input to use. If n is smaller than the length of the input, the input is cropped. If it is larger, the input is padded with zeros. If n is not given, the length of the input along the axis specified by axis is used.

  • axis (int, optional) – Axis over which to compute the inverse FFT. If not given, the last axis is used.

  • norm (str, optional) – Normalization mode, indicates which direction of the forward/backward pair of transforms is scaled and with what normalization factor. Include {“backward”, “ortho”, “forward”}, default value 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

complex tensor.

Return type

out(Tensor)

Examples:

import paddle

spectrum = paddle.to_tensor([10.0, -5.0, 0.0, -1.0, 0.0, -5.0])
print(paddle.fft.ifft(spectrum))
# Tensor(shape=[6], dtype=complex64, place=CUDAPlace(0), stop_gradient=True,
#       [(-0.1666666716337204+0j),  (1-1.9868215517249155e-08j), (2.3333334922790527-1.9868215517249155e-08j),  (3.5+0j), (2.3333334922790527+1.9868215517249155e-08j),  (1+1.9868215517249155e-08j)])
print(paddle.fft.ihfft(spectrum))
#  Tensor(shape = [4], dtype = complex64, place = CUDAPlace(0), stop_gradient = True,
#         [(-0.1666666716337204+0j),  (1-1.9868215517249155e-08j), (2.3333334922790527-1.9868215517249155e-08j),  (3.5+0j)])