n_3=sqrt(0.1)*randn(1,K); n_4=sqrt(0.1)*randn(1,K); beta_NLoS=(n_3+1i*n_4); % CN(0,0.1)
I want to create a $CN(0,0.1)$,does my code have any problem?
Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It only takes a minute to sign up.Sign up to join this community
If you want a Circular Complex Gaussian Noise (Independent):
vComplexNoise = sqrt(noiseVar / 2) * (randn(1, numSamples) + (1i * randn(1, numSamples)))
For correlated noise you'll need to define the Co Variance Matrix and use Cholesky Decomposition.
Following @Stanley Pawlukiewicz advise, run the following code:
numSamples = 100000; noiseVar = 4; mA = sqrt(noiseVar / 2) * (randn(numSamples, 1) + (1i * randn(numSamples, 1))); var(mA)
You should see result which is very close to
noiseVar on the screen.