fftshift
The fftshift function is a utility in signal processing and numerical computing, commonly found in libraries such as NumPy in Python and MATLAB. Its primary purpose is to shift the zero-frequency component of a signal to the center of the spectrum. This is particularly useful in the context of the Fast Fourier Transform (FFT), where the zero-frequency component is typically located at the beginning of the output array.
In the context of the FFT, the zero-frequency component corresponds to the average value of the signal.
The fftshift function achieves this by rearranging the elements of the input array. Specifically, it swaps
In addition to its use in signal processing, the fftshift function is also used in other fields,