Tag Archives: MATLAB

Simple MATLAB code to show the zero-correlation between sample of white Gaussian noise

Let be a Nx1 vector that contains pseudorandom samples drawn from standard normal distribution. This represents N samples taken from a standard normal distribution at time ‘t’.

The correlation of the sequence is given by E[xH]

This means, we need to compute the matrix xH M (M is a very large number) times, sum up all the matrices, and divide the resultant matrix by M. We can see that as M tends to infinity, we get a diagonal matrix as output. If the variance of the noise distribution is 1, then we get an identity matrix.

Z=10;
N=1000000
Y=zeros(Z,Z);
for i=0:N-1
    x=randn(Z,1);
    X=x*x';
    Y=Y+X;
end
Y./N
Tagged , ,
%d bloggers like this: