# nlcpy.fft.irfftn

nlcpy.fft.irfftn(a, s=None, axes=None, norm=None)[ソース]

Computes the inverse of the n-dimensional FFT of a real array.

This function computes the inverse of the n-dimensional discrete fourier transform for a real array 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 to within numerical accuracy. (The a.shape is necessary like len(a) is for irfft(), and for the same reason.)

The input should be ordered in the same way as is returned by rfftn(), i.e. as for irfft() for the final transformation axis, and as for ifftn() along all the other axes.

Parameters
aarray_like

Input array.

ssequence of int, optional

Shape (length of each transformed axis) of the output (s refers to axis 0, s to axis 1, etc.). s is also the number of input points used along this axis, except for the last axis, where s[-1]//2+1 points of the input are used. Along any axis, if the shape indicated by s is smaller than that of the input, the input is cropped. If it is larger, the input is padded with zeros. If s is not given, the shape of the input along the axes specified by axes is used. Except for the last axis which is taken to be 2*(m-1) where m is the length of the input along that axis. If s and axes have different length, ValueError occurs.

axessequence of ints, optional

Axes over which to compute the inverse FFT. If not given, the last len(s) axes are used, or all axes if s is also not specified. Repeated indices in axes means that the inverse transform over that axis is performed multiple times. If an element of axes is larger than than the number of axes of a, IndexError occurs.

norm{None, "ortho"},optional

Normalization mode. By default(None), the transforms are scaled by . It norm is set to "ortho", the return values will be scaled by .

Returns
outndarray

The truncated or zero-padded input, transformed along the axes indicated by axes, or by a combination of s or a, as explained in the parameters section above. The length of each transformed axis is as given by the corresponding element of s, or the length of the input in every axis except for the last one if s is not given. In the final transformed axis the length of the output when s is not given is 2*(m-1) where m is the length of the final transformed axis of the input. To get an odd number of output points in the final axis, s must be specified.

rfftn

Computes the n-dimensional discrete fourier transform for a real array.

fft

Computes the one-dimensional discrete fourier transform.

irfft

Computes the inverse of the n-point DFT for a real array.

irfft2

Computes the 2-dimensional inverse FFT of a real array.

See fft() for definitions and conventions used.

See rfft() for definitions and conventions used for a real array.

The correct interpretation of the hermitian input depends on the shape of the original data, as given by s. This is because each input shape could correspond to either an odd or even length signal. By default, irfftn assumes an even output length which puts the last entry at the Nyquist frequency; aliasing with its symmetric counterpart. When performing the final complex to real transform, the last value is thus treated as purely real. To avoid losing information, the correct shape of the real array must be given.

Examples

>>> import nlcpy as vp
>>> a = vp.zeros((3, 2, 2))
>>> a[0, 0, 0] = 3 * 2 * 2
>>> vp.fft.irfftn(a)
array([[[1., 1.],
[1., 1.]],

[[1., 1.],
[1., 1.]],

[[1., 1.],
[1., 1.]]])