This is a pre-release version (2.5.0.dev0+git20251130.2de293a). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / fft / rfft2

_ArrayFunctionDispatcher

numpy.fft:rfft2

source: build-install/usr/lib/python3.14/site-packages/numpy/fft/_pocketfft.py :1393

Signature

def   rfft2 ( a s = None axes = (-2, -1) norm = None out = None )

Summary

Compute the 2-dimensional FFT of a real array.

Parameters

a : array

Input array, taken to be real.

s : sequence of ints, optional

Shape of the FFT.

axes : sequence of ints, optional

Axes over which to compute the FFT. Default: (-2, -1).

norm : {"backward", "ortho", "forward"}, optional

Normalization mode (see numpy.fft). Default is "backward". Indicates which direction of the forward/backward pair of transforms is scaled and with what normalization factor.

out : complex ndarray, optional

If provided, the result will be placed in this array. It should be of the appropriate shape and dtype for the last inverse transform. incompatible with passing in all but the trivial s).

Returns

out : ndarray

The result of the real 2-D FFT.

Notes

This is really just rfftn with different default behavior. For more details see rfftn.

Examples

import numpy as np
a = np.mgrid[:5, :5][0]
np.fft.rfft2(a)

See also

rfftn

Compute the N-dimensional discrete Fourier Transform for real input.

Aliases

  • numpy.fft.rfft2

Referenced by