我正在查看 matlab 项目中的一些 FFT 代码,FFT 和逆 FFT 是这样计算的:
% Here image is a 2D image.
image_fft = fftshift(image,1);
image_fft = fftshift(image_fft,2);
image_fft = fft(image_fft,[],1);
image_fft = fft(image_fft,[],2);
image_fft = fftshift(image_fft,1);
image_fft = fftshift(image_fft,2);
% Some processing and then same sequence of fftshift, ifft and fftshift to move to
% time domain
我试图在网上找到一些信息,但不知道为什么在计算 FFT 之前需要完成 fftshift。
我的另一个问题是这是否真的是 Matlab 特有的东西。例如,我计划将此代码移植到 C++ 并使用 KISS FFT。我需要对此有所不同吗?