ifftshift - Inverse zero-frequency shift - MATLAB (original) (raw)

Main Content

Inverse zero-frequency shift

Syntax

Description

X = ifftshift([Y](#bvi4cjj-1-Y)) rearranges a zero-frequency-shifted Fourier transform Y back to the original transform output. In other words, ifftshift undoes the result of fftshift.

example

X = ifftshift([Y](#bvi4cjj-1-Y),[dim](#bvi4cjj-1-dim)) operates along the dimension dim of Y. For example, if Y is a matrix whose rows represent multiple 1-D transforms, then ifftshift(Y,2) swaps the halves of each row of Y.

example

Examples

collapse all

You can use the fftshift and ifftshift functions to swap left and right halves of a vector.

Create a vector containing an odd number of elements, and swap the left and right sides of the vector using the fftshift function.

V = [1 2 3 4 5 6 7]; X = fftshift(V)

Use the ifftshift function to swap the left and right sides of X. The result is the same as the original vector V.

Calling the fftshift function twice does not necessarily reconstruct the original input.

Rearrange the rows of a matrix to shift the nonnegative elements to the left.

Y = [-2 -1 0 1 2; -10 -5 0 5 10]; X = ifftshift(Y,2)

X = 2×5

 0     1     2    -2    -1
 0     5    10   -10    -5

Input Arguments

collapse all

Input array, specified as a vector, a matrix, or a multidimensional array.

Data Types: double | single | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical
Complex Number Support: Yes

Dimension to operate along, specified as a positive integer scalar. If no value is specified, then ifftshift swaps along all dimensions.

Data Types: double | single | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical

Extended Capabilities

expand all

The ifftshift function fully supports GPU arrays. To run the function on a GPU, specify the input data as a gpuArray (Parallel Computing Toolbox). For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).

Version History

Introduced before R2006a