On this page
numpy.fft.irfftn
numpy.fft.irfftn(a, s=None, axes=None, norm=None)[source]-
Compute the inverse of the N-dimensional FFT of real input.
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) == ato within numerical accuracy. (Thea.shapeis necessary likelen(a)is forirfft, and for the same reason.)The input should be ordered in the same way as is returned by
rfftn, i.e. as forirfftfor the final transformation axis, and as forifftnalong all the other axes.Parameters: -
a : array_like -
Input array.
-
s : sequence of ints, optional -
Shape (length of each transformed axis) of the output (
s[0]refers to axis 0,s[1]to axis 1, etc.).sis also the number of input points used along this axis, except for the last axis, wheres[-1]//2+1points of the input are used. Along any axis, if the shape indicated bysis smaller than that of the input, the input is cropped. If it is larger, the input is padded with zeros. Ifsis not given, the shape of the input along the axes specified byaxesis used. -
axes : sequence of ints, optional -
Axes over which to compute the inverse FFT. If not given, the last
len(s)axes are used, or all axes ifsis also not specified. Repeated indices inaxesmeans that the inverse transform over that axis is performed multiple times. -
norm : {None, “ortho”}, optional -
New in version 1.10.0.
Normalization mode (see
numpy.fft). Default is None.
Returns: -
out : ndarray -
The truncated or zero-padded input, transformed along the axes indicated by
axes, or by a combination ofsora, as explained in the parameters section above. The length of each transformed axis is as given by the corresponding element ofs, or the length of the input in every axis except for the last one ifsis not given. In the final transformed axis the length of the output whensis not given is2*(m-1)wheremis the length of the final transformed axis of the input. To get an odd number of output points in the final axis,smust be specified.
Raises: - ValueError
-
If
sandaxeshave different length. - IndexError
-
If an element of
axesis larger than than the number of axes ofa.
See also
Notes
See
fftfor definitions and conventions used.See
rfftfor definitions and conventions used for real input.Examples
>>> a = np.zeros((3, 2, 2)) >>> a[0, 0, 0] = 3 * 2 * 2 >>> np.fft.irfftn(a) array([[[1., 1.], [1., 1.]], [[1., 1.], [1., 1.]], [[1., 1.], [1., 1.]]]) -
© 2005–2019 NumPy Developers
Licensed under the 3-clause BSD License.
https://docs.scipy.org/doc/numpy-1.17.0/reference/generated/numpy.fft.irfftn.html