Navigation

Operators and Keywords

Function List:

C++ API

: fftshift (x)
: fftshift (x, dim)

Perform a shift of the vector x, for use with the fft and ifft functions, in order to move the frequency 0 to the center of the vector or matrix.

If x is a vector of N elements corresponding to N time samples spaced by dt, then fftshift (fft (x)) corresponds to frequencies

f = [ -(ceil((N-1)/2):-1:1), 0, (1:floor((N-1)/2)) ] * df

where df = 1 / (N * dt).

If x is a matrix, the same holds for rows and columns. If x is an array, then the same holds along each dimension.

The optional dim argument can be used to limit the dimension along which the permutation occurs.

See also: ifftshift.

Package: octave