{ } Raw JSON

bundles / scipy 1.17.1 / scipy / fft / _helper / ifftshift

function

scipy.fft._helper:ifftshift

source: /scipy/fft/_helper.py :315

Signature

def   ifftshift ( x axes = None )

Summary

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.

Notes

Array API Standard Support

ifftshift has experimental support for Python Array API Standard compatible backends in addition to NumPy. Please consider testing these features by setting an environment variable SCIPY_ARRAY_API=1 and providing CuPy, PyTorch, JAX, or Dask arrays as array arguments. The following combinations of backend and device (or other capability) are supported.

====================  ====================  ====================
Library               CPU                   GPU
====================  ====================  ====================
NumPy                 ✅                     n/a                 
CuPy                  n/a                   ✅                   
PyTorch               ✅                     ✅                   
JAX                   ✅                     ✅                   
Dask                  ✅                     n/a                 
====================  ====================  ====================

See dev-arrayapi for more information.

Examples

import numpy as np
freqs = np.fft.fftfreq(9, d=1./9).reshape(3, 3)
freqs
np.fft.ifftshift(np.fft.fftshift(freqs))

See also

fftshift

Shift zero-frequency component to the center of the spectrum.

Aliases

  • scipy.fft.ifftshift