Wiener-Khinchin 定理指出自相关函数和功率谱密度是傅里叶变换对 - 请参阅Wikipidia(以及许多其他资源)。
这意味着自相关应该能够通过傅里叶逆变换光谱来获得。下面的代码(在 Octave 中运行,带有“pkg load signal”)显示了自相关的傅里叶变换确实看起来像频谱,但频谱的傅里叶逆变换看起来不像自相关。我做错什么了?
### A signal's autocorrelation and its Engergy Spectral Density are Fourier transform pairs.
### signal
Fs = 1000;
t = 0:1/Fs:1-1/Fs;
x = cos(2*pi*100*t)+randn(size(t));
#plot(x);
### autocorrelation
Rxx = xcorr(x);
#figure();
plot(Rxx); title("Rxx");
### autocorrelation FT
RxxDftAbs = abs(fftshift(fft(Rxx)));
freq = -Fs/2:Fs/length(Rxx):Fs/2-(Fs/length(Rxx));
figure();
plot(freq,RxxDftAbs); title("RxxDftAbs");
### Energy Spectral Density
xdft = abs(fftshift(fft(x)));
x_esd = xdft.^2; # ESD is the same as autocorrelation FT. Here for visualization purpose, using absolute values.
freq = -Fs/2:Fs/length(x_esd):Fs/2-(Fs/length(x_esd));
figure();
plot(freq,x_esd); title("x esd");
### ?????????????
### is it possible to get autocorrelation from the ESD by inverse Fourier transform?
### ?????????????
### IFT of ESD
x_esd_idft_abs = abs(ifft(fftshift(x_esd)));
figure();
plot(x_esd_idft_abs); title("x esd ift");
提前致谢。