Why is this function used to generate white gaussian noise

10 views (last 30 days)
n = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)];

Answers (2)

Walter Roberson
Walter Roberson on 24 Aug 2012
The code generates random complex numbers and normalizes them to a maximum of 1 unit of magnitude.
What is the context, such that complex signals are appropriate?

Daniel Shub
Daniel Shub on 24 Aug 2012
One of the neat properties of Gaussian noise is that the real and imaginary components of the Fourier transform of a Gaussian noise are Gaussian. If you are working in the frequency domain, your code is identical, in a stochastic sense, to
n = fft(randn(1, N));
but obviously more efficient.
If you are interested in the magnitudes and phases of the components, instead of the real and imaginary components, you could create the Gaussian noise by creating magnitudes which are Rayleigh distributed and phases which are uniformly distributed.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!