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);
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?