hfft

hfft(x: array, /, *, n: int | None = None, axis: int = -1, norm: Literal['backward', 'ortho', 'forward'] = 'backward') array

Computes the one-dimensional discrete Fourier transform of a signal with Hermitian symmetry.

Parameters:
  • x (array) – input array. Should have a complex-valued floating-point data type.

  • n (Optional[int]) –

    number of elements along the transformed axis (dimension) specified by axis in the output array. Let M be the size of the input array along the axis specified by axis. When n is None, the function must set n equal to 2*(M-1).

    • If n//2+1 is greater than M, the axis of the input array specified by axis must be zero-padded to length n//2+1.

    • If n//2+1 is less than M, the axis of the input array specified by axis must be trimmed to size n//2+1.

    • If n//2+1 equals M, all elements along the axis of the input array specified by axis must be used when computing the transform.

    Default: None.

  • axis (int) – axis (dimension) of the input array over which to compute the transform. A valid axis must be an integer on the interval [-N, N), where N is the rank (number of dimensions) of x. If an axis is specified as a negative integer, the function must determine the axis along which to compute the transform by counting backward from the last dimension (where -1 refers to the last dimension). Default: -1.

  • norm (Literal['backward', 'ortho', 'forward']) –

    normalization mode. Should be one of the following modes:

    • 'backward': no normalization.

    • 'ortho': normalize by 1/sqrt(n) (i.e., make the FFT orthonormal).

    • 'forward': normalize by 1/n.

    Default: 'backward'.

Returns:

out (array) – an array transformed along the axis (dimension) specified by axis. The returned array must have a real-valued floating-point data type whose precision matches the precision of x (e.g., if x is complex128, then the returned array must have a float64 data type). The returned array must have the same shape as x, except for the axis specified by axis which must have size n.

Notes

New in version 2022.12.