How to generate correlated gaussian noises
Generate 3 channels of correlated gaussian noise:
%Here we use 3 uncorrelated gaussian noise as input, whose mean's are 0 and Std's are 1.
%Here is your covariance matrix, if all channels of signals have a Std of 1, then it is your correlation coefficient matrix.
sigma=[1.0 0.2 0.8;
0.2 1.0 0.5;
0.8 0.5 1.0];
%Do the Cholesky Decomposition of your covariance matrix sigma.
%Transform the input to 3 channels of correlated output.
% Let's see whether the covariance matrix of X now.
% Write Data to binary file
fid = fopen('RNG.out', 'wb');
fwrite(fid, X, 'double');