Rearrange the elements of the FFT of a vector or matrix.
|A two-dimensional array or a vector, typically the output of |
|An array of the same size as the input. The output contains the same elements but in a different order as described below.
For a one-dimensional array, the element
fft is the transform of the
input at the frequencey
exp(2*pi*i*k/N), k=0,1,...N-1 where
N is the
x . Likewise, the element
z[j+1,k+1] of the output
is the transform of the input at the frequencies
exp(2*pi*i*j/M), exp(2*pi*i*k/N) with
j=0,1,...M-1 , and
N are the row and column dimensions of
fftshift rearranges the outputs of
fft2 so that the zero frequency is at the center
of the spectrum.
If the input is a vector,
fftshift swaps the upper
and lower half of the vector.
If the input is a matrix, the first and third quadrants
as well as the second and fourth quadrants are swapped.