jax.numpy.fft.ifftshift — JAX documentation (original) (raw)
jax.numpy.fft.ifftshift#
jax.numpy.fft.ifftshift(x, axes=None)[source]#
The inverse of jax.numpy.fft.fftshift().
JAX implementation of numpy.fft.ifftshift().
Parameters:
- x (ArrayLike) – N-dimensional array array of frequencies.
- axes (None | int | Sequence _[_int]) – optional integer or sequence of integers specifying which axes to shift. If None (default), then shift all axes.
Returns:
A shifted copy of x.
Return type:
See also
- jax.numpy.fft.fftshift(): inverse of
ifftshift. - jax.numpy.fft.fftfreq(): generate FFT frequencies.
Examples
Generate FFT frequencies with fftfreq():
freq = jnp.fft.fftfreq(5) freq Array([ 0. , 0.2, 0.4, -0.4, -0.2], dtype=float32)
Use fftshift() to shift the zero-frequency entry to the middle of the array:
shifted_freq = jnp.fft.fftshift(freq) shifted_freq Array([-0.4, -0.2, 0. , 0.2, 0.4], dtype=float32)
Unshift with ifftshift to recover the original frequencies:
jnp.fft.ifftshift(shifted_freq) Array([ 0. , 0.2, 0.4, -0.4, -0.2], dtype=float32)