flopscope.

flopscope.numpy.fft.ifftshift

fnp.fft.ifftshift(x, axes=None)[flopscope source][numpy source]

The inverse of `fftshift`. Although identical for even-length `x`, the functions differ by one sample for odd-length `x`.

Adapted from NumPy docs np.fft.ifftshift

Areafft
Typefree
Cost
0
Flopscope Context

Inverse of fftshift. No arithmetic; index reordering only.

The inverse of fftshift. Although identical for even-length x, the functions differ by one sample for odd-length x.

Parameters

x:array_like

Input array.

axes:int or shape tuple, optional

Axes over which to calculate. Defaults to None, which shifts all axes.

Returns

y:ndarray

The shifted array.

See also

Examples

>>> import flopscope.numpy as fnp
>>> freqs = flops.fft.fftfreq(9, d=1./9).reshape(3, 3)
>>> freqs
array([[ 0.,  1.,  2.],
       [ 3.,  4., -4.],
       [-3., -2., -1.]])
>>> flops.fft.ifftshift(flops.fft.fftshift(freqs))
array([[ 0.,  1.,  2.],
       [ 3.,  4., -4.],
       [-3., -2., -1.]])