MATLAB Functions | Help Desk |
fftshift
Move zero'th lag to center of spectrum.
Y = fftshift(X)
Y = fftshift(X)
rearranges the outputs of fft
and fft2
by moving the zero frequency component to the center of the spectrum, which is sometimes a more convenient form.
If X
is a vector, Y
is a vector with the left and right halves swapped.
If X
is a matrix, Y
is a matrix with quadrants one and three swapped with quadrants two and four.
For any matrix X
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)this DC component is near the center of the matrix.
fft
One-dimensional fast Fourier transform
fft2
Two-dimensional fast Fourier transform