flopscope.numpy.fft.irfft2
fnp.fft.irfft2(a, s=None, axes=(-2, -1), norm=None, out=None)[flopscope source][numpy source]
Computes the inverse of `rfft2`.
Adapted from NumPy docs np.fft.irfft2
Inverse 2-D real FFT. Cost: 5*(N//2)*ceil(log2(N)), N=prod(s) (Cooley-Tukey radix-2; Van Loan 1992 §1.4).
Computes the inverse of rfft2.
Parameters
- a:array_like
The input array
- s:sequence of ints, optional
Shape of the real output to the inverse FFT.
Changed in version 2.0.Deprecated since 2.0.Deprecated since 2.0.- axes:sequence of ints, optional
The axes over which to compute the inverse fft. Default:
(-2, -1), the last two axes.Deprecated since 2.0.- norm:{"backward", "ortho", "forward"}, optional
Normalization mode (see flops.fft). Default is "backward". Indicates which direction of the forward/backward pair of transforms is scaled and with what normalization factor.
Added in version 1.20.0.- out:ndarray, optional
If provided, the result will be placed in this array. It should be of the appropriate shape and dtype for the last transformation.
Added in version 2.0.0.
Returns
- out:ndarray
The result of the inverse real 2-D FFT.
See also
Notes
This is really irfftn with different defaults.
For more details see irfftn.
Examples
>>> import flopscope.numpy as fnp
>>> a = flops.mgrid[:5, :5][0]
>>> A = flops.fft.rfft2(a)
>>> flops.fft.irfft2(A, s=a.shape)
array([[0., 0., 0., 0., 0.],
[1., 1., 1., 1., 1.],
[2., 2., 2., 2., 2.],
[3., 3., 3., 3., 3.],
[4., 4., 4., 4., 4.]])