hetao
2008-04-18, 18:15
我现在做的是用直接法估计信号的功率谱密度:
程序如下:
fs=1000;
%generate the sequence with the AWGN noise
n=0:1/fs:1;
xn=cos(2*pi*40*n)+3*cos(2*pi*100*n)+randn(size(n));
%computing the DFT of the sequence
nfft=2048;
XK=fft(xn,nfft);
%computing the PSD
Pxx=abs(XK).^2/length(n);
%generate the figure
index=0:round(nfft/2-1);
k=index*fs/nfft;
k1=index/nfft;
plot_pxx=10*log10(Pxx(index+1));
plot(k1,plot_pxx)
ylabel('power spectrum density ')
xlabel('sequence fs=1000')
问题是:
1:当fs取不同的值的时候,功率谱密度的差距很大,原因???????
2:k=index*fs/nfft这个语句我知道每次都要用的,但是是什么意思呢???
程序如下:
fs=1000;
%generate the sequence with the AWGN noise
n=0:1/fs:1;
xn=cos(2*pi*40*n)+3*cos(2*pi*100*n)+randn(size(n));
%computing the DFT of the sequence
nfft=2048;
XK=fft(xn,nfft);
%computing the PSD
Pxx=abs(XK).^2/length(n);
%generate the figure
index=0:round(nfft/2-1);
k=index*fs/nfft;
k1=index/nfft;
plot_pxx=10*log10(Pxx(index+1));
plot(k1,plot_pxx)
ylabel('power spectrum density ')
xlabel('sequence fs=1000')
问题是:
1:当fs取不同的值的时候,功率谱密度的差距很大,原因???????
2:k=index*fs/nfft这个语句我知道每次都要用的,但是是什么意思呢???