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

Function irfftn

numpy/fft/_pocketfft.py:1261–1367  ·  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)

Source from the content-addressed store, hash-verified

1259
1260@array_function_dispatch(_fftn_dispatcher)
1261def irfftn(a, s=None, axes=None, norm=None):
1262 """
1263 Computes the inverse of `rfftn`.
1264
1265 This function computes the inverse of the N-dimensional discrete
1266 Fourier Transform for real input over any number of axes in an
1267 M-dimensional array by means of the Fast Fourier Transform (FFT). In
1268 other words, ``irfftn(rfftn(a), a.shape) == a`` to within numerical
1269 accuracy. (The ``a.shape`` is necessary like ``len(a)`` is for `irfft`,
1270 and for the same reason.)
1271
1272 The input should be ordered in the same way as is returned by `rfftn`,
1273 i.e. as for `irfft` for the final transformation axis, and as for `ifftn`
1274 along all the other axes.
1275
1276 Parameters
1277 ----------
1278 a : array_like
1279 Input array.
1280 s : sequence of ints, optional
1281 Shape (length of each transformed axis) of the output
1282 (``s[0]`` refers to axis 0, ``s[1]`` to axis 1, etc.). `s` is also the
1283 number of input points used along this axis, except for the last axis,
1284 where ``s[-1]//2+1`` points of the input are used.
1285 Along any axis, if the shape indicated by `s` is smaller than that of
1286 the input, the input is cropped. If it is larger, the input is padded
1287 with zeros. If `s` is not given, the shape of the input along the axes
1288 specified by axes is used. Except for the last axis which is taken to
1289 be ``2*(m-1)`` where ``m`` is the length of the input along that axis.
1290 axes : sequence of ints, optional
1291 Axes over which to compute the inverse FFT. If not given, the last
1292 `len(s)` axes are used, or all axes if `s` is also not specified.
1293 Repeated indices in `axes` means that the inverse transform over that
1294 axis is performed multiple times.
1295 norm : {"backward", "ortho", "forward"}, optional
1296 .. versionadded:: 1.10.0
1297
1298 Normalization mode (see `numpy.fft`). Default is "backward".
1299 Indicates which direction of the forward/backward pair of transforms
1300 is scaled and with what normalization factor.
1301
1302 .. versionadded:: 1.20.0
1303
1304 The "backward", "forward" values were added.
1305
1306 Returns
1307 -------
1308 out : ndarray
1309 The truncated or zero-padded input, transformed along the axes
1310 indicated by `axes`, or by a combination of `s` or `a`,
1311 as explained in the parameters section above.
1312 The length of each transformed axis is as given by the corresponding
1313 element of `s`, or the length of the input in every axis except for the
1314 last one if `s` is not given. In the final transformed axis the length
1315 of the output when `s` is not given is ``2*(m-1)`` where ``m`` is the
1316 length of the final transformed axis of the input. To get an odd
1317 number of output points in the final axis, `s` must be specified.
1318

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