rfft2

Contents

rfft2#

class saiunit.fft.rfft2(a, s=None, axes=(-2, -1), norm=None, **kwargs)#

Compute a two-dimensional DFT of a real-valued array.

Unit-aware implementation of numpy.fft.rfft2(). Only the positive-frequency half along the last transformed axis is returned. The output unit is input_unit * second ** 2.

Parameters:
  • a (saiunit.Quantity | Array | ndarray | bool | number | bool | int | float | complex) – Real-valued input with a.ndim >= 2.

  • s (Sequence[int] | None) – Effective shape (length-2) of the input along axes.

  • axes (Sequence[int]) – Axes over which to compute the 2-D real DFT.

  • norm (str | None) – Normalization mode.

Returns:

Two-dimensional real DFT of a.

Return type:

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

See also

saiunit.fft.irfft2

Inverse of rfft2.

saiunit.fft.rfftn

N-dimensional real 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, 5.0, 6.0]]) * u.meter
>>> X = sufft.rfft2(x)