xrscipy.fftpack.ifft
- xrscipy.fftpack.ifft(x, coord, n=None)
Return discrete inverse Fourier transform of real or complex sequence.
The returned complex array contains
y(0), y(1),..., y(n-1)
, wherey(j) = (x * exp(2*pi*sqrt(-1)*j*np.arange(n)/n)).mean()
.- Parameters:
obj (xarray object) – Transformed data to invert.
coord (string) – Coordinate along which the ifft’s are computed. The coordinate must be evenly spaced.
n (int, optional) – Length of the inverse Fourier transform. If
n < x.shape[axis]
, x is truncated. Ifn > x.shape[axis]
, x is zero-padded. The default results inn = x.shape[axis]
.
- Returns:
ifft – The inverse discrete Fourier transform.
- Return type:
ndarray of floats
See also
fft
Forward FFT
numpy.fftpack.ifft
scipy.fft.ifft : Original scipy implementation
Notes
Both single and double precision routines are implemented. Half precision inputs will be converted to single precision. Non-floating-point inputs will be converted to double precision. Long-double precision inputs are not supported.
This function is most efficient when n is a power of two, and least efficient when n is prime.
If the data type of x is real, a “real IFFT” algorithm is automatically used, which roughly halves the computation time.
Examples
>>> from scipy.fftpack import fft, ifft >>> import numpy as np >>> x = np.arange(5) >>> np.allclose(ifft(fft(x)), x, atol=1e-15) # within numerical accuracy. True