Home > atmlab > randomize > make_noise.m

make_noise

PURPOSE ^

MAKE_NOISE Create noise vectors with desired covariance

SYNOPSIS ^

function noise = make_noise(n,S)

DESCRIPTION ^

 MAKE_NOISE   Create noise vectors with desired covariance

 Usage:
 noise = make_noise(n,S)

 Input:
 n : How many vectors to generate
 S : Covariance matrix

 Output:
 noise : noise vectors, dimensions [dim(S),n]

 2005-07-22 Stefan Buehler

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

make_noise.m

SOURCE CODE ^

0001 % MAKE_NOISE   Create noise vectors with desired covariance
0002 %
0003 % Usage:
0004 % noise = make_noise(n,S)
0005 %
0006 % Input:
0007 % n : How many vectors to generate
0008 % S : Covariance matrix
0009 %
0010 % Output:
0011 % noise : noise vectors, dimensions [dim(S),n]
0012 %
0013 % 2005-07-22 Stefan Buehler
0014 
0015 function noise = make_noise(n,S)
0016 
0017 % We use the Cholesky decomposition to generate random vectors with
0018 % the right correlation. This trick is stolen from Patrick's
0019 % randmvar_normal function in atmlab.
0020 noise = chol(S)'*randn(length(S),n);
0021

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005