2
$\begingroup$

I want to know the difference between the two Gaussian noises generated below? Which one is white and how can i make the other one white?

y=wgn(1,10000,0)

and

y=randn(1,10000);
$\endgroup$
4
  • $\begingroup$ Welcome to DSP.SE! They are both white. Why do you think otherwise? $\endgroup$
    – Peter K.
    Commented May 4, 2016 at 14:31
  • $\begingroup$ because it is not mentioned in the matlab help that they are white. i believe they are just samples of a gaussian distribution. $\endgroup$
    – zahraesb
    Commented May 4, 2016 at 14:46
  • $\begingroup$ thank u Peter.im happy to be here.actually i'm having a hard time distinguishing the difference between whitness of samples and their gaussianity.i believe some samples generated of a specific distribution are not white(or uncorrelated) by them self and we shoud white them $\endgroup$
    – zahraesb
    Commented May 4, 2016 at 14:57
  • $\begingroup$ randn produces independent samples of a Gaussian random variable, which happens to be the same as Gaussian white noise. Note that this white noise is actually filtered to fit in the bandwidth specified by the sampling rate. $\endgroup$
    – MBaz
    Commented May 4, 2016 at 15:02

2 Answers 2

5
$\begingroup$

A white noise sequence is one for which each (random) element is uncorrelated from every other element: $$ E[y[n]y[m]] = \left \{ \begin{array}{ll} 0 & \mbox{for } n\not=m\\ \sigma_y^2 & \mbox{for } n = m \end{array} \right . \\= \sigma_y^2 \delta[n-m] $$ where $\sigma^2_y$ is the variance of $y$.

Note that I am assuming (because of the whiteness) that the signal is zero mean.

The whiteness of a signal says nothing about the distribution of its values. To know something about that, Gaussianity or some other distribution needs to be invoked.

The functions wgn and randn both produce white, Gaussian noise sequences.

Calling the function rand would produce a white, uniformly distributed noise sequence.

$\endgroup$
3
  • $\begingroup$ A white noise sequence is one for which each s̶a̶m̶p̶l̶e̶ ̶i̶s̶ ̶s̶t̶a̶t̶i̶s̶t̶i̶c̶a̶l̶l̶y̶ ̶i̶n̶d̶e̶p̶e̶n̶d̶e̶n̶t̶ ̶f̶r̶o̶m̶ ̶e̶v̶e̶r̶y̶ ̶o̶t̶h̶e̶r̶ ̶s̶a̶m̶p̶l̶e̶ (random) element is statistically independent from every other element $\endgroup$
    – toes
    Commented Jan 24, 2019 at 14:27
  • $\begingroup$ @toes What is the impact of your suggested change? Feel free to edit and have it reviewed. $\endgroup$
    – Peter K.
    Commented Jan 24, 2019 at 18:48
  • 1
    $\begingroup$ I misquoted in my previous comment. Should've read ...is uncorrelated from every other element... Post is corrected now anyway $\endgroup$
    – toes
    Commented Jan 30, 2019 at 16:59
2
$\begingroup$

wgn() is specifically meant to create a white noise with a predefined power levels while randn() is meant to generate normally distributed random numbers WITHOUT specifying the power. You will have to scale the values generated from randn() to meet the desired noise power level. Basically wgn() (usually used with awgn()) makes your life easier if you want to create a noise with known power level.

Hope this helps!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.