numpy.fft.rfft2
- fft.rfft2(a, s=None, axes=(-2, -1), norm=None, out=None)
Compute the 2-dimensional FFT of a real array.
- Parameters:
Compute the 2-dimensional FFT of a real array.
Input array, taken to be real.
Shape of the FFT.
Axes over which to compute the FFT. Default: (-2, -1).
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.
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).
The result of the real 2-D FFT.
>>> import numpy as np
>>> a = np.mgrid[:5, :5][0]
>>> np.fft.rfft2(a)
array([[ 50. +0.j , 0. +0.j , 0. +0.j ],
[-12.5+17.20477401j, 0. +0.j , 0. +0.j ],
[-12.5 +4.0614962j , 0. +0.j , 0. +0.j ],
[-12.5 -4.0614962j , 0. +0.j , 0. +0.j ],
[-12.5-17.20477401j, 0. +0.j , 0. +0.j ]])