# The difference between the variance of white noise and narrow-band noise in Matlab

In Matlab, we can generate noise with zero-mean and unit variance by using "n = randn()". But in fact, the variance is not really equal to 1, but there is a slight error.

Assume that the length of the noise sequence is a constant of N. I generated the noise sequence many times, and calculated the variance of each noise sequence. Finally, I compared each variance with 1, and calculated the MSE (mean square error). For example, I have got the MSE which is around 1 * 10^-6.

Now, I generate narrow-band noise by using a low pass filter. The order of the filter is very high. After scaling, the variance of the filtered noise returns to around 1. But again, there is a slight error. I calculate the MSE as above, and I found that the MSE is around 5 * 10^-6.

Is the MSE getting larger due to the low pass filter? Is there any way to eliminate it? Thank you!

• You are deriving an estimate of the variance by averaging many different values. As any statistical estimate, it is subject to some variation. Having said this, what exactly are you trying to minimise? – A_A Jan 7 at 10:33
• en.m.wikipedia.org/wiki/Law_of_large_numbers – Stanley Pawlukiewicz Jan 7 at 15:20