MCPcopy Create free account
hub / github.com/numpy/numpy / irfft2

Function irfft2

numpy/fft/_pocketfft.py:1371–1424  ·  view source on GitHub ↗

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. axes : sequence of ints, optional The axes over which to compute the inverse fft.

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

Source from the content-addressed store, hash-verified

1369
1370@array_function_dispatch(_fftn_dispatcher)
1371def irfft2(a, s=None, axes=(-2, -1), norm=None):
1372 """
1373 Computes the inverse of `rfft2`.
1374
1375 Parameters
1376 ----------
1377 a : array_like
1378 The input array
1379 s : sequence of ints, optional
1380 Shape of the real output to the inverse FFT.
1381 axes : sequence of ints, optional
1382 The axes over which to compute the inverse fft.
1383 Default is the last two axes.
1384 norm : {"backward", "ortho", "forward"}, optional
1385 .. versionadded:: 1.10.0
1386
1387 Normalization mode (see `numpy.fft`). Default is "backward".
1388 Indicates which direction of the forward/backward pair of transforms
1389 is scaled and with what normalization factor.
1390
1391 .. versionadded:: 1.20.0
1392
1393 The "backward", "forward" values were added.
1394
1395 Returns
1396 -------
1397 out : ndarray
1398 The result of the inverse real 2-D FFT.
1399
1400 See Also
1401 --------
1402 rfft2 : The forward two-dimensional FFT of real input,
1403 of which `irfft2` is the inverse.
1404 rfft : The one-dimensional FFT for real input.
1405 irfft : The inverse of the one-dimensional FFT of real input.
1406 irfftn : Compute the inverse of the N-dimensional FFT of real input.
1407
1408 Notes
1409 -----
1410 This is really `irfftn` with different defaults.
1411 For more details see `irfftn`.
1412
1413 Examples
1414 --------
1415 >>> a = np.mgrid[:5, :5][0]
1416 >>> A = np.fft.rfft2(a)
1417 >>> np.fft.irfft2(A, s=a.shape)
1418 array([[0., 0., 0., 0., 0.],
1419 [1., 1., 1., 1., 1.],
1420 [2., 2., 2., 2., 2.],
1421 [3., 3., 3., 3., 3.],
1422 [4., 4., 4., 4., 4.]])
1423 """
1424 return irfftn(a, s, axes, norm)

Callers

nothing calls this directly

Calls 1

irfftnFunction · 0.85

Tested by

no test coverage detected