Signal Processing Toolbox | ![]() ![]() |
Rearrange the outputs of the FFT functions.
Syntax
y =
fftshift(x)
Description
y
rearranges the outputs of =
fftshift(x)
fft
and fft2
by moving the zero frequency component to the center of the spectral density, which is sometimes a more convenient form.
For vectors, fftshift(x)
returns a vector with the left and right halves swapped.
For arrays, fftshift(x)
swaps quadrants one and three with quadrants two and four.
The fftshift
function is part of the standard MATLAB language.
Examples
Y =
fft2(x)
has Y(1,1) = sum(sum(X))
; the DC component of the signal is in the upper-left corner of the two-dimensional FFT. For
Z =
fftshift(Y)
the DC component is near the center of the matrix.
See Also
|
One-dimensional fast Fourier transform. |
|
Two-dimensional fast Fourier transform. |
![]() | fftfilt | filter | ![]() |