MATLAB Function Reference
  Go to function:
    Search    Help Desk 
fftshift    Examples   See Also

Shift DC component of fast Fourier transform to center of spectrum

Syntax

Description

Y = fftshift(X) rearranges the outputs of fft, fft2, and fftn by moving the zero frequency component to the center of the array.

For vectors, fftshift(X) swaps the left and right halves of X. For matrices, fftshift(X) swaps quadrants one and three of X with quadrants two and four. For higher-dimensional arrays, fftshift(X) swaps "half-spaces" of X along each dimension.

Examples

For any matrix 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

this DC component is near the center of the matrix.

See Also

fft         One-dimensional fast Fourier transform

fft2        Two-dimensional fast Fourier transform

fftn        Multidimensional fast Fourier transform



[ Previous | Help Desk | Next ]