irfft

Contents

irfft#

class brainunit.fft.irfft(a, n=None, axis=-1, norm=None, **kwargs)#

Compute a real-valued one-dimensional inverse DFT.

Unit-aware implementation of numpy.fft.irfft(). The output unit is input_unit / second.

Parameters:
  • a (saiunit.Quantity | Array | ndarray | bool | number | bool | int | float | complex) – Input spectrum (typically from rfft()).

  • n (int | None) – Length of the output along axis. Defaults to 2 * (m - 1) where m is the length of a along axis.

  • axis (int) – Axis along which the inverse FFT is computed.

  • norm (str | None) – Normalization mode.

Returns:

Real-valued inverse DFT of a with length n along axis.

Return type:

saiunit.Quantity | Array | ndarray | bool | number | bool | int | float | complex

See also

saiunit.fft.rfft

One-dimensional real DFT (forward).

saiunit.fft.irfftn

N-dimensional real inverse DFT.

Examples

>>> import saiunit as u
>>> import saiunit.fft as sufft
>>> import jax.numpy as jnp
>>> x = jnp.array([1.0, 2.0, 3.0, 4.0]) * u.meter
>>> X = sufft.rfft(x)
>>> x_back = sufft.irfft(X)