Hi, I just wanted to check that the matlab function "pwelch" gives a correct estimates of the PSD of a gaussian white noise. I plot the estimate of the PSD and also the variance, which is supposed to be equal to the mean of PSD. I always have a bias that I don't understand.
Here's my code :
sigma = 1000;
L = 200000;
noise= randn(1,L) * sigma;
[PSD_noise,vect_freq_noise] = pwelch(noise,75000,[],4000);
plot(vect_freq_noise,2*PSD_noise,'-g'),
hold on, plot([vect_freq_noise(1) vect_freq_noise(end)],[sigma^2 sigma^2],'r');
plot([vect_freq_noise(1) vect_freq_noise(end)],[mean(2*PSD_noise) mean(2*PSD_noise)],'b');
Any idea where's the mistake?
Thank you
1 Comment
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/105368-power-spectral-density-of-gaussian-white-noise#comment_178819
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/105368-power-spectral-density-of-gaussian-white-noise#comment_178819
Sign in to comment.