MCPcopy Index your code
hub / github.com/numpy/numpy / irfftn

Function irfftn

numpy/fft/_pocketfft.py:1474–1609  ·  view source on GitHub ↗

Computes the inverse of `rfftn`. This function computes the inverse of the N-dimensional discrete Fourier Transform for real input over any number of axes in an M-dimensional array by means of the Fast Fourier Transform (FFT). In other words, ``irfftn(rfftn(a), a.shape) == a``

(a, s=None, axes=None, norm=None, out=None)

Source from the content-addressed store, hash-verified

1472
1473@array_function_dispatch(_fftn_dispatcher)
1474def irfftn(a, s=None, axes=None, norm=None, out=None):
1475 """
1476 Computes the inverse of `rfftn`.
1477
1478 This function computes the inverse of the N-dimensional discrete
1479 Fourier Transform for real input over any number of axes in an
1480 M-dimensional array by means of the Fast Fourier Transform (FFT). In
1481 other words, ``irfftn(rfftn(a), a.shape) == a`` to within numerical
1482 accuracy. (The ``a.shape`` is necessary like ``len(a)`` is for `irfft`,
1483 and for the same reason.)
1484
1485 The input should be ordered in the same way as is returned by `rfftn`,
1486 i.e. as for `irfft` for the final transformation axis, and as for `ifftn`
1487 along all the other axes.
1488
1489 Parameters
1490 ----------
1491 a : array_like
1492 Input array.
1493 s : sequence of ints, optional
1494 Shape (length of each transformed axis) of the output
1495 (``s[0]`` refers to axis 0, ``s[1]`` to axis 1, etc.). `s` is also the
1496 number of input points used along this axis, except for the last axis,
1497 where ``s[-1]//2+1`` points of the input are used.
1498 Along any axis, if the shape indicated by `s` is smaller than that of
1499 the input, the input is cropped. If it is larger, the input is padded
1500 with zeros.
1501
1502 .. versionchanged:: 2.0
1503
1504 If it is ``-1``, the whole input is used (no padding/trimming).
1505
1506 If `s` is not given, the shape of the input along the axes
1507 specified by axes is used. Except for the last axis which is taken to
1508 be ``2*(m-1)`` where ``m`` is the length of the input along that axis.
1509
1510 .. deprecated:: 2.0
1511
1512 If `s` is not ``None``, `axes` must not be ``None`` either.
1513
1514 .. deprecated:: 2.0
1515
1516 `s` must contain only ``int`` s, not ``None`` values. ``None``
1517 values currently mean that the default value for ``n`` is used
1518 in the corresponding 1-D transform, but this behaviour is
1519 deprecated.
1520
1521 axes : sequence of ints, optional
1522 Axes over which to compute the inverse FFT. If not given, the last
1523 `len(s)` axes are used, or all axes if `s` is also not specified.
1524 Repeated indices in `axes` means that the inverse transform over that
1525 axis is performed multiple times.
1526
1527 .. deprecated:: 2.0
1528
1529 If `s` is specified, the corresponding `axes` to be transformed
1530 must be explicitly specified too.
1531

Callers 1

irfft2Function · 0.85

Calls 4

asarrayFunction · 0.90
_cook_nd_argsFunction · 0.85
ifftFunction · 0.85
irfftFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…