jax.numpy.fft.ihfft#

jax.numpy.fft.ihfft(a, n=None, axis=-1, norm=None)[source]#

Compute a 1-D inverse FFT of an array whose spectrum has Hermitian-symmetry.

JAX implementation of numpy.fft.ihfft().

Parameters:
  • a (ArrayLike) – input array.

  • n (int | None | None) – optional, int. Specifies the effective dimension of the input along axis. If not specified, it will default to the dimension of input along axis.

  • axis (int) – optional, int, default=-1. Specifies the axis along which the transform is computed. If not specified, the transform is computed along axis -1.

  • norm (str | None | None) – optional, string. The normalization mode. “backward”, “ortho” and “forward” are supported. Default is “backward”.

Returns:

An array containing one-dimensional discrete Fourier transform of a by exploiting its inherent Hermitian symmetry. The dimension of the array along axis is (n/2)+1, if n is even and (n+1)/2, if n is odd.

Return type:

Array

See also

Examples

>>> x = jnp.array([[1, 3, 5, 7],
...                [2, 4, 6, 8]])
>>> jnp.fft.ihfft(x)
Array([[ 4.+0.j, -1.-1.j, -1.-0.j],
       [ 5.+0.j, -1.-1.j, -1.-0.j]], dtype=complex64)

When n=4 and axis=0, dimension of the transform along axis 0 will be (4/2)+1 =3 and dimension along other axes will be same as that of input.

>>> jnp.fft.ihfft(x, n=4, axis=0)
Array([[ 0.75+0.j ,  1.75+0.j ,  2.75+0.j ,  3.75+0.j ],
       [ 0.25+0.5j,  0.75+1.j ,  1.25+1.5j,  1.75+2.j ],
       [-0.25-0.j , -0.25-0.j , -0.25-0.j , -0.25-0.j ]], dtype=complex64)