Engee documentation

fftshift

Page in progress.

The shift of the constant component to the center of the spectrum.

Library

EngeeDSP

Syntax

Function call

  • Y = fftshift(X) — rewrites the Fourier transform of the array X, shifting the constant component to the center of the array.

    • If X — vector, then function fftshift swaps the left and right halves X.

    • If X — the matrix, then the function fftshift swaps the first quadrant X with the third, and the second quadrant with the fourth.

    • If X — a multidimensional array, then the function fftshift swaps half spaces X for each dimension.

  • Y = fftshift(X,dim) — works by dimension dim array X. For example, if X — a matrix whose rows represent several one-dimensional transformations, then fftshift(X,2) swaps the halves of each row of the matrix X.

Arguments

Input arguments

# X — input array

+ vector | matrix | multidimensional array

Details

An input array specified as a vector, matrix, or multidimensional array.

Data types

Float64, Float32, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool

Support for complex numbers

Yes

# dim — the measurement by which the operation is performed

+ positive integer scalar

Details

The dimension on which the operation is performed is specified as a positive integer. If the value is not specified, then the function fftshift swaps all dimensions.

  • Consider the input matrix Xc. Operation fftshift(Xc,1) swaps the halves of each column of the matrix Xc.

    fftshift 1

  • Consider the matrix Xr. Operation fftshift(Xr,2) swaps the halves of each row of the matrix Xr.

    fftshift 2

Data types

Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64

Output arguments

# Y — output array

Details

The output array returned as a vector, matrix, or multidimensional array.