離散 fft に奇妙な問題があります。ガウス関数 exp(-x^2/2) のフーリエ変換も同じガウス関数 exp(-k^2/2) であることを知っています。MatLab と FFTW の簡単なコードでテストしようとしましたが、奇妙な結果が得られました。
まず、結果の虚数部は (MatLab では) 本来あるべきゼロではありません。
第 2 に、実部の絶対値はガウス曲線ですが、絶対値がなければモードの半分は負の係数を持ちます。より正確には、すべての 2 番目のモードには、本来あるべき負の係数があります。
第 3 に、(実数部の絶対値を取った後の) 結果のガウス曲線のピークは 1 ではなく、はるかに高くなります。その高さは、x 軸上のポイントの数に比例します。ただし、比例係数は 1 ではなく、ほぼ 1/20 です。
誰かが私が間違っていることを説明してもらえますか?
私が使用したMatLabコードは次のとおりです。
function [nooutput,M] = fourier_test
Nx = 512; % number of points in x direction
Lx = 50; % width of the window containing the Gauss curve
x = linspace(-Lx/2,Lx/2,Nx); % creating an equidistant grid on the x-axis
input_1d = exp(-x.^2/2); % Gauss function as an input
input_1d_hat = fft(input_1d); % computing the discrete FFT
input_1d_hat = fftshift(input_1d_hat); % ordering the modes such that the peak is centred
plot(real(input_1d_hat), '-')
hold on
plot(imag(input_1d_hat), 'r-')