FFTSHIFT

Purpose:

Shifts a 1D or 2D FFT so the 0 frequency is the midpoint.

Syntax:

FFTSHIFT(series)

series

-

Any series or multi-column table.

Returns:

A series or array.

Example:

W1: {1, 2, 3, 2, 1}

W2: fft(W1)

W3: fftshift(W2)

 

The zero frequency (i.e. DC) value of W2 is the first point. The zero frequency of W3 is the 3rd point and appears in the middle of the resulting graph.

Example:

W1: gcos(100, .01, 10);setvunits("V")

W2: fftp(w1, 8*1024)

W3: fftshift(w2)

 

image\fftshiftpic.png

 

The frequency peaks in W3 appear at +- 10 Hertz.

Remarks:

By default, the FFT output spans frequencies from 0 Hz to the sampling rate Fs, with the zero-frequency (DC) component at the beginning of the array. The FFTSHIFT function reorders this output by shifting the zero-frequency component to the center, creating a symmetric frequency axis that ranges from -Fs/2 to +Fs/2. This centered representation is often more intuitive for visualization and analysis, particularly when examining both positive and negative frequency components.

 

FFTSHIFT also works on 2D FFT array.

 

See IFFTSHIFT to undo the shift produced by FFTSHIFT.

See Also:

CIRCSHIFT

FFT

FFT2

IFFTSHIFT