hfftn

paddle.fft. hfftn ( x, s=None, axes=None, norm='backward', name=None ) [source]

Compute the N-D FFT of Hermitian symmetric complex input, i.e., a signal with a real spectrum.

This function calculates the n-D discrete Fourier transform of Hermite symmetric complex input on any axis in M-D array by fast Fourier transform (FFT). In other words, ihfftn(hfftn(x, s)) == x is within the numerical accuracy range. (s here are x.shape and s[-1] = x.shape[- 1] * 2 - 1. This is necessary for the same reason that irfft requires x.shape.)

Parameters
  • x (Tensor) – The input data. It’s a Tensor type.

  • s (sequence of ints, optional) – The length of the output transform axis. (s[0] refers to axis 0, s[1] to axis 1, etc.). s is also the number of input points used along this axis, except for the last axis, where s[-1]//2+1 points of the input are used. Along any axis, if the shape indicated by s is smaller than that of the input, the input is cropped. If it is larger, the input is padded with zeros. If s is not given, the shape of the input along the axes specified by axes is used. Except for the last axis which is taken to be 2*(k-1) where k is the length of the input along that axis.

  • axes (sequence of ints, optional) – Axes over which to compute the inverse FFT. If not given, the last len(s) axes are used, or all axes if s is also not specified.

  • norm (str, optional) – Indicates which direction to scale the forward or backward transform pair and what normalization factor to use. The parameter value must be one of “forward” or “backward” or “ortho”. 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

Real tensor. Truncate or zero fill input, transforming along the axis indicated by axis or a combination of s or X.

Examples

>>> import paddle

>>> x = paddle.to_tensor([(2+2j), (2+2j), (3+3j)])
>>> hfftn_x = paddle.fft.hfftn(x)
>>> print(hfftn_x)
Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
[9., 3., 1., -5.])