qslazio
Full Member level 3
calculate psd
I'm writing a Matlab m-file to calculate PSD of sinusoid signal.
However the output puzzle me a lot.
Below is the m-file:
------------------------------------------------------------------
fs =1e10;
fi =1e8;
amp =1;
nbpts =4e5;
t =[0:1/fs:nbpts/fs];
sig =amp*sin(2*pi*fi*t);
Hs = spectrum.periodogram('rectangular');
Hdsp2 = psd(Hs,sig,'Fs',fs,'NFFT',nbpts,'SpectrumType','onesided');
Pow = avgpower(Hdsp2,[0.9*fi,1.1*fi]);
plot(Hdsp2);
------------------------------------------------------------------
Here, I intended to calculate psd of this sinusoid of which the frequency is 100Meg Hz and amplitude is 1. I expected to see this 0.5*δ(w-100Meg) impulse on this one-sided PSD plot.
But instead, there is a impulse of which the amplitude is around -50dB, which I cannot explain it at all.
Can anyone tell me what's wrong with the m-file?
Thank in advance!!
I'm writing a Matlab m-file to calculate PSD of sinusoid signal.
However the output puzzle me a lot.
Below is the m-file:
------------------------------------------------------------------
fs =1e10;
fi =1e8;
amp =1;
nbpts =4e5;
t =[0:1/fs:nbpts/fs];
sig =amp*sin(2*pi*fi*t);
Hs = spectrum.periodogram('rectangular');
Hdsp2 = psd(Hs,sig,'Fs',fs,'NFFT',nbpts,'SpectrumType','onesided');
Pow = avgpower(Hdsp2,[0.9*fi,1.1*fi]);
plot(Hdsp2);
------------------------------------------------------------------
Here, I intended to calculate psd of this sinusoid of which the frequency is 100Meg Hz and amplitude is 1. I expected to see this 0.5*δ(w-100Meg) impulse on this one-sided PSD plot.
But instead, there is a impulse of which the amplitude is around -50dB, which I cannot explain it at all.
Can anyone tell me what's wrong with the m-file?
Thank in advance!!