What is the difference between fftshift and ifftshift in matlab?

What is the difference between fftshift and ifftshift in matlab?

The two are actually different.
fftshift is to swap the left and right sides of the data:
x=[1 2 3 4] fftshift(x) ->[3 4 1 2]
ifftshift is a function added when the data is not an even length:
x=[1 2 3 4 5] ifftshift(x) ->[4 5 3 1 2]

(1) Ifftshift and fftshift both perform circular displacement operations. Fftshift is a circular shift of the array or matrix in the positive direction (right and down), while ifftshift is the circular shift in the negative direction (left and up). The step length of the circular displacement is equal to half the length of the array or matrix, which is N/2 for even numbers and (N-1)/2 for odd numbers. This is why the results of fftshift and ifftshift are the same for even-length arrays, but the results are different for odd-length arrays.
(2) Two fftshifts cannot restore the sequence to its original state, but use it as follows:
ifftshift(fftshift(A))=A

Guess you like

Origin blog.csdn.net/yxnooo1/article/details/108315811