numpy.fft.ifftshift#
- fft.ifftshift(x, axes=None)[原始碼]#
The inverse of
fftshift. Although identical for even-length x, the functions differ by one sample for odd-length x.- 參數:
- xarray_like
Input array.
- axesint or shape tuple, optional
Axes over which to calculate. Defaults to None, which shifts all axes.
- 回傳值:
- yndarray
The shifted array.
也參考
fftshiftShift zero-frequency component to the center of the spectrum.
範例
>>> import numpy as np >>> freqs = np.fft.fftfreq(9, d=1./9).reshape(3, 3) >>> freqs array([[ 0., 1., 2.], [ 3., 4., -4.], [-3., -2., -1.]]) >>> np.fft.ifftshift(np.fft.fftshift(freqs)) array([[ 0., 1., 2.], [ 3., 4., -4.], [-3., -2., -1.]])