Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
how can i generate a White Gaussian Noise in Matlab 2009

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: Artur Racu

Date: 26 May, 2010 08:19:06

Message: 1 of 27

hy all,

so i hope what my problem is clear to everyone, i need to generate a WGN(actually i need those values becouse i want to implement them in Eurostag),

thank you,

Artur

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: David Young

Date: 26 May, 2010 09:04:06

Message: 2 of 27

I don't know what Eurostag is, but in Matlab the function I would use to generate an approximation to white Gaussian noise is randn.

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: Artur Racu

Date: 26 May, 2010 09:22:04

Message: 3 of 27

"David Young" <d.s.young.notthisbit@sussex.ac.uk> wrote in message <htio66$ch9$1@fred.mathworks.com>...
> I don't know what Eurostag is, but in Matlab the function I would use to generate an approximation to white Gaussian noise is randn.

Eurostag is a tool used for dynamic computation of power systems, i want to creat a signal(white gausian noise) so i can make a disturbance in power system and after to analyse different things;

for example n=randn(10) if you take the mean of each column you will see that the mean is not zero(for white noise the main roule is t have the mean zero)

could you please help me on that,

thank you

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: Artur Racu

Date: 26 May, 2010 09:28:03

Message: 4 of 27

"Artur Racu" <arturracu@yahoo.com> wrote in message <htilhq$m70$1@fred.mathworks.com>...
> hy all,
>
> so i hope what my problem is clear to everyone, i need to generate a WGN(actually i need those values becouse i want to implement them in Eurostag),
>
> thank you,
>
> Artur

more details--during 15s i need to generate a white gaussian noise;

please help; any ideas are well recieved,

Artur

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: TideMan

Date: 26 May, 2010 09:29:30

Message: 5 of 27

On May 26, 9:22 pm, "Artur Racu" <arturr...@yahoo.com> wrote:
> "David Young" <d.s.young.notthis...@sussex.ac.uk> wrote in message <htio66$ch...@fred.mathworks.com>...
> > I don't know what Eurostag is, but in Matlab the function I would use to generate an approximation to white Gaussian noise is randn.
>
> Eurostag is a tool used for dynamic computation of power systems, i want to creat a signal(white gausian noise) so i can make a disturbance in power system and after to analyse different things;
>
> for example n=randn(10) if you take the mean of each column you will see that the mean is not zero(for white noise the main roule is t have the mean zero)
>
> could you please help me on that,
>
> thank you

Oh, don't be so silly!!
Of course the mean will be different from zero with only 10 numbers.
Now try this:
mean(randn(1000000,1))
Is that close enough to zero for you?
If not, try this:
mean(randn(100000000,1))

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: us

Date: 26 May, 2010 09:37:04

Message: 6 of 27

TideMan <mulgor@gmail.com> wrote in message <9267ac3c-bdc7-4582-b2d2-747404c2bc6e@y18g2000prn.googlegroups.com>...
> On May 26, 9:22 pm, "Artur Racu" <arturr...@yahoo.com> wrote:
> > "David Young" <d.s.young.notthis...@sussex.ac.uk> wrote in message <htio66$ch...@fred.mathworks.com>...
> > > I don't know what Eurostag is, but in Matlab the function I would use to generate an approximation to white Gaussian noise is randn.
> >
> > Eurostag is a tool used for dynamic computation of power systems, i want to creat a signal(white gausian noise) so i can make a disturbance in power system and after to analyse different things;
> >
> > for example n=randn(10) if you take the mean of each column you will see that the mean is not zero(for white noise the main roule is t have the mean zero)
> >
> > could you please help me on that,
> >
> > thank you
>
> Oh, don't be so silly!!
> Of course the mean will be different from zero with only 10 numbers.
> Now try this:
> mean(randn(1000000,1))
> Is that close enough to zero for you?
> If not, try this:
> mean(randn(100000000,1))

but... derek, how mean(!)...

     mean(randn(100000000,1))
%{
??? Error using ==> randn
Out of memory. Type HELP MEMORY for your options.
%}

us

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: Artur Racu

Date: 26 May, 2010 09:38:04

Message: 7 of 27

TideMan <mulgor@gmail.com> wrote in message <9267ac3c-bdc7-4582-b2d2-747404c2bc6e@y18g2000prn.googlegroups.com>...
> On May 26, 9:22 pm, "Artur Racu" <arturr...@yahoo.com> wrote:
> > "David Young" <d.s.young.notthis...@sussex.ac.uk> wrote in message <htio66$ch...@fred.mathworks.com>...
> > > I don't know what Eurostag is, but in Matlab the function I would use to generate an approximation to white Gaussian noise is randn.
> >
> > Eurostag is a tool used for dynamic computation of power systems, i want to creat a signal(white gausian noise) so i can make a disturbance in power system and after to analyse different things;
> >
> > for example n=randn(10) if you take the mean of each column you will see that the mean is not zero(for white noise the main roule is t have the mean zero)
> >
> > could you please help me on that,
> >
> > thank you
>
> Oh, don't be so silly!!
> Of course the mean will be different from zero with only 10 numbers.
> Now try this:
> mean(randn(1000000,1))
> Is that close enough to zero for you?
> If not, try this:
> mean(randn(100000000,1))
 it is ok...but you know then the chief want that the mean to be zero it is very hard to convience him that this answer is good

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: us

Date: 26 May, 2010 09:43:05

Message: 8 of 27

"Artur Racu"
> > Oh, don't be so silly!!
> > Of course the mean will be different from zero with only 10 numbers.
> > Now try this:
> > mean(randn(1000000,1))
> > Is that close enough to zero for you?
> > If not, try this:
> > mean(randn(100000000,1))
> it is ok...but you know then the chief want that the mean to be zero it is very hard to convience him that this answer is good

one of the (few) solutions

% fire the chief...

us

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: Artur Racu

Date: 26 May, 2010 10:18:05

Message: 9 of 27

"Artur Racu" <arturracu@yahoo.com> wrote in message <htilhq$m70$1@fred.mathworks.com>...
> hy all,
>
> so i hope what my problem is clear to everyone, i need to generate a WGN(actually i need those values becouse i want to implement them in Eurostag),
>
> thank you,
>
> Artur

so...any ideas how can i obtain Gauss curve values,
thank you

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: TideMan

Date: 26 May, 2010 10:49:45

Message: 10 of 27

On May 26, 9:37 pm, "us " <u...@neurol.unizh.ch> wrote:
> TideMan <mul...@gmail.com> wrote in message <9267ac3c-bdc7-4582-b2d2-747404c2b...@y18g2000prn.googlegroups.com>...
> > On May 26, 9:22 pm, "Artur Racu" <arturr...@yahoo.com> wrote:
> > > "David Young" <d.s.young.notthis...@sussex.ac.uk> wrote in message <htio66$ch...@fred.mathworks.com>...
> > > > I don't know what Eurostag is, but in Matlab the function I would use to generate an approximation to white Gaussian noise is randn.
>
> > > Eurostag is a tool used for dynamic computation of power systems, i want to creat a signal(white gausian noise) so i can make a disturbance in power system and after to analyse different things;
>
> > > for example n=randn(10) if you take the mean of each column you will see that the mean is not zero(for white noise the main roule is t have the mean zero)
>
> > > could you please help me on that,
>
> > > thank you
>
> > Oh, don't be so silly!!
> > Of course the mean will be different from zero with only 10 numbers.
> > Now try this:
> > mean(randn(1000000,1))
> > Is that close enough to zero for you?
> > If not, try this:
> > mean(randn(100000000,1))
>
> but... derek, how mean(!)...
>
>      mean(randn(100000000,1))
> %{
> ??? Error using ==> randn
> Out of memory. Type HELP MEMORY for your options.
> %}
>
> us

Oh, Urs, you poor old thing.
You need to ask your employers to give you a better computer.
Here is what mine says:

>> mean(randn(100000000,1))

ans =

  2.1549e-005

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: TideMan

Date: 26 May, 2010 10:50:50

Message: 11 of 27

On May 26, 10:18 pm, "Artur Racu" <arturr...@yahoo.com> wrote:
> "Artur Racu" <arturr...@yahoo.com> wrote in message <htilhq$m7...@fred.mathworks.com>...
> > hy all,
>
> > so i hope what my problem is clear to everyone, i need to generate a WGN(actually i need those values becouse i want to implement them in Eurostag),
>
> > thank you,
>
> > Artur
>
> so...any ideas how can i obtain Gauss curve values,
> thank you

Use randn, you silly man. How else?

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: Artur Racu

Date: 26 May, 2010 11:38:04

Message: 12 of 27

TideMan <mulgor@gmail.com> wrote in message <9c8a0f15-c6d7-495b-aba3-11380fc8ab4c@23g2000pre.googlegroups.com>...
> On May 26, 10:18 pm, "Artur Racu" <arturr...@yahoo.com> wrote:
> > "Artur Racu" <arturr...@yahoo.com> wrote in message <htilhq$m7...@fred.mathworks.com>...
> > > hy all,
> >
> > > so i hope what my problem is clear to everyone, i need to generate a WGN(actually i need those values becouse i want to implement them in Eurostag),
> >
> > > thank you,
> >
> > > Artur
> >
> > so...any ideas how can i obtain Gauss curve values,
> > thank you
>
> Use randn, you silly man. How else?

thank you Tideman but in the future please be more polite otherwise it's better do not give answers

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: Steven Lord

Date: 26 May, 2010 13:49:43

Message: 13 of 27


"Artur Racu" <arturracu@yahoo.com> wrote in message
news:htiq5s$lld$1@fred.mathworks.com...
> TideMan <mulgor@gmail.com> wrote in message
> <9267ac3c-bdc7-4582-b2d2-747404c2bc6e@y18g2000prn.googlegroups.com>...
>> On May 26, 9:22 pm, "Artur Racu" <arturr...@yahoo.com> wrote:
>> > "David Young" <d.s.young.notthis...@sussex.ac.uk> wrote in message
>> > <htio66$ch...@fred.mathworks.com>...
>> > > I don't know what Eurostag is, but in Matlab the function I would use
>> > > to generate an approximation to white Gaussian noise is randn.
>> >
>> > Eurostag is a tool used for dynamic computation of power systems, i
>> > want to creat a signal(white gausian noise) so i can make a disturbance
>> > in power system and after to analyse different things;
>> >
>> > for example n=randn(10) if you take the mean of each column you will
>> > see that the mean is not zero(for white noise the main roule is t have
>> > the mean zero)
>> >
>> > could you please help me on that,
>> >
>> > thank you
>>
>> Oh, don't be so silly!!
>> Of course the mean will be different from zero with only 10 numbers.
>> Now try this:
>> mean(randn(1000000,1))
>> Is that close enough to zero for you?
>> If not, try this:
>> mean(randn(100000000,1))
> it is ok...but you know then the chief want that the mean to be zero it is
> very hard to convience him that this answer is good

In theory, the mean of a set of numbers generated using RANDN will be 0.
In practice, it won't.
Here's a smaller example that may convince your chief that expecting exactly
the theoretical result in practice is not always a good idea.

Take a six-sided die and roll it once. The mean value of the "sequence" of
numbers generated by that roll is whatever number came up on the die -- but
the theoretical mean is 3.5. That's not achievable with one roll of that
standard die. Even if you choose to roll that die a large odd number of
times, you will never be able to achieve the theoretical mean of that number
of rolls as all the numbers on the die are integers.

If that argument doesn't work, then point him to Wikipedia (particularly the
second example on this page):

http://en.wikipedia.org/wiki/Law_of_averages

If nothing else that should occupy him for a few hours following links to
interesting topics :)

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: Walter Roberson

Date: 26 May, 2010 14:40:40

Message: 14 of 27

Artur Racu wrote:

> it is ok...but you know then the chief want that the mean to be zero it
> is very hard to convience him that this answer is good

So subtract off the mean that you do get, and the result will be have a
mean of 0 (to within round-off error.) On the other hand, if you do
that, you are generating data with one less degree of freedom than if
you leave the mean alone, and any such constrained data would, by
definition, not be WGN.

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: Artur Racu

Date: 26 May, 2010 15:21:05

Message: 15 of 27

"Steven Lord" <slord@mathworks.com> wrote in message <htj8tb$leh$1@fred.mathworks.com>...
>
> "Artur Racu" <arturracu@yahoo.com> wrote in message
> news:htiq5s$lld$1@fred.mathworks.com...
> > TideMan <mulgor@gmail.com> wrote in message
> > <9267ac3c-bdc7-4582-b2d2-747404c2bc6e@y18g2000prn.googlegroups.com>...
> >> On May 26, 9:22 pm, "Artur Racu" <arturr...@yahoo.com> wrote:
> >> > "David Young" <d.s.young.notthis...@sussex.ac.uk> wrote in message
> >> > <htio66$ch...@fred.mathworks.com>...
> >> > > I don't know what Eurostag is, but in Matlab the function I would use
> >> > > to generate an approximation to white Gaussian noise is randn.
> >> >
> >> > Eurostag is a tool used for dynamic computation of power systems, i
> >> > want to creat a signal(white gausian noise) so i can make a disturbance
> >> > in power system and after to analyse different things;
> >> >
> >> > for example n=randn(10) if you take the mean of each column you will
> >> > see that the mean is not zero(for white noise the main roule is t have
> >> > the mean zero)
> >> >
> >> > could you please help me on that,
> >> >
> >> > thank you
> >>
> >> Oh, don't be so silly!!
> >> Of course the mean will be different from zero with only 10 numbers.
> >> Now try this:
> >> mean(randn(1000000,1))
> >> Is that close enough to zero for you?
> >> If not, try this:
> >> mean(randn(100000000,1))
> > it is ok...but you know then the chief want that the mean to be zero it is
> > very hard to convience him that this answer is good
>
> In theory, the mean of a set of numbers generated using RANDN will be 0.
> In practice, it won't.
> Here's a smaller example that may convince your chief that expecting exactly
> the theoretical result in practice is not always a good idea.
>
> Take a six-sided die and roll it once. The mean value of the "sequence" of
> numbers generated by that roll is whatever number came up on the die -- but
> the theoretical mean is 3.5. That's not achievable with one roll of that
> standard die. Even if you choose to roll that die a large odd number of
> times, you will never be able to achieve the theoretical mean of that number
> of rolls as all the numbers on the die are integers.
>
> If that argument doesn't work, then point him to Wikipedia (particularly the
> second example on this page):
>
> http://en.wikipedia.org/wiki/Law_of_averages
>
> If nothing else that should occupy him for a few hours following links to
> interesting topics :)
>
> --
> Steve Lord
> slord@mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com
>
thank you Steve Lord

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: Anyone

Date: 26 May, 2010 19:34:38

Message: 16 of 27

TideMan wrote on 26-May-10 03:49 ...
> On May 26, 9:37 pm, "us " <u...@neurol.unizh.ch> wrote:
>> TideMan <mul...@gmail.com> wrote in message <9267ac3c-bdc7-4582-b2d2-747404c2b...@y18g2000prn.googlegroups.com>...
>>> On May 26, 9:22 pm, "Artur Racu" <arturr...@yahoo.com> wrote:
>>>> "David Young" <d.s.young.notthis...@sussex.ac.uk> wrote in message <htio66$ch...@fred.mathworks.com>...
>>>>> I don't know what Eurostag is, but in Matlab the function I would use to generate an approximation to white Gaussian noise is randn.
>>>> Eurostag is a tool used for dynamic computation of power systems, i want to creat a signal(white gausian noise) so i can make a disturbance in power system and after to analyse different things;
>>>> for example n=randn(10) if you take the mean of each column you will see that the mean is not zero(for white noise the main roule is t have the mean zero)
>>>> could you please help me on that,
>>>> thank you
>>> Oh, don't be so silly!!
>>> Of course the mean will be different from zero with only 10 numbers.
>>> Now try this:
>>> mean(randn(1000000,1))
>>> Is that close enough to zero for you?
>>> If not, try this:
>>> mean(randn(100000000,1))
>> but... derek, how mean(!)...
>>
>> mean(randn(100000000,1))
>> %{
>> ??? Error using ==> randn
>> Out of memory. Type HELP MEMORY for your options.
>> %}
>>
>> us
>
> Oh, Urs, you poor old thing.
> You need to ask your employers to give you a better computer.
> Here is what mine says:
>
>>> mean(randn(100000000,1))
>
> ans =
>
> 2.1549e-005

 >> mean(randn(100000000,1))
ans =
  -1.9690e-004

"neener-neener"

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: Bruno Luong

Date: 26 May, 2010 19:54:04

Message: 17 of 27

Anyone <""Zrqt\"@³@Qi§QUm![§H:\"&z25u/g`MpEr)\"{ETq[opZ\"Vz.az?"> wrote in message <4bfd77cd$0$32006$c3e8da3@news.astraweb.com>...
>
>
> >> mean(randn(100000000,1))

Did someone mention this is a rich and slow way of doing

>> randn/10000

Is there an obligation to run the expensive computer offered by the boss?

Bruno

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: Walter Roberson

Date: 26 May, 2010 19:59:21

Message: 18 of 27

Bruno Luong wrote:
> Anyone <""Zrqt\"@³@Qi§QUm![§H:\"&z25u/g`MpEr)\"{ETq[opZ\"Vz.az?"> wrote
> in message <4bfd77cd$0$32006$c3e8da3@news.astraweb.com>...

>> >> mean(randn(100000000,1))

> Did someone mention this is a rich and slow way of doing
>>> randn/10000

No it isn't. By the Law Of Large Numbers, mean(randn(N,1)) for large N will
have a much lower mean and standard deviation than randn(1,1)/sqrt(N) will.

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: Ken

Date: 26 May, 2010 21:09:56

Message: 19 of 27

> In theory, the mean of a set of numbers generated using RANDN will be 0.
> In practice, it won't.
> Here's a smaller example that may convince your chief that expecting exactly
> the theoretical result in practice is not always a good idea.
>
> Take a six-sided die and roll it once.  The mean value of the "sequence" of
> numbers generated by that roll is whatever number came up on the die -- but
> the theoretical mean is 3.5.  That's not achievable with one roll of that
> standard die.  Even if you choose to roll that die a large odd number of
> times, you will never be able to achieve the theoretical mean of that number
> of rolls as all the numbers on the die are integers.
>
> If that argument doesn't work, then point him to Wikipedia (particularly the
> second example on this page):
>
> http://en.wikipedia.org/wiki/Law_of_averages
>
> If nothing else that should occupy him for a few hours following links to
> interesting topics :)
>
> --
> Steve Lord
> sl...@mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ:http://matlabwiki.mathworks.com/MATLAB_FAQ
> To contact Technical Support use the Contact Us link onhttp://www.mathworks.com


hey,

just to have fun being technical:

in theory, the mean of a set of numbers generated using randn *is a
random variable with a distribution centered at zero*, whose standard
deviation tightens as you increase the size of the set. in the limit
of infinite numbers in the set, the probability density function
becomes a delta function at zero (probability 1).

wouldn't be worth mentioning except you're implying a difference
between theory and practice that doesn't exist. actually, in theory,
you will NEVER get exactly zero with a finite set of numbers (because
you're integrating the probability density function "from zero to
zero").

artur: the true statement would be "for white noise, the EXPECTED mean
is zero." also, if I'm understanding you right re: "gaussian curve
values", use normpdf() or mvnpdf().

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: TideMan

Date: 26 May, 2010 21:20:07

Message: 20 of 27

I think I've come up with the perfect sop for Artur's boss who doesn't
like the mean of 10 random numbers not being exactly zero.
round(mean(randn(10,1)))

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: us

Date: 26 May, 2010 21:24:05

Message: 21 of 27

Walter Roberson <roberson@hushmail.com> wrote in message <JpaLn.17955$h57.156@newsfe22.iad>...
> Artur Racu wrote:
>
> > it is ok...but you know then the chief want that the mean to be zero it
> > is very hard to convience him that this answer is good
>
> So subtract off the mean that you do get, and the result will be have a
> mean of 0 (to within round-off error.)

walter the magician...
that's exactly IT...

us

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: Artur Artur

Date: 26 May, 2010 21:34:04

Message: 22 of 27

Ken <ken.colwell@gmail.com> wrote in message <cbca5506-8ca7-4458-8454-8e305aac654a@r9g2000vbk.googlegroups.com>...
> > In theory, the mean of a set of numbers generated using RANDN will be 0.
> > In practice, it won't.
> > Here's a smaller example that may convince your chief that expecting exactly
> > the theoretical result in practice is not always a good idea.
> >
> > Take a six-sided die and roll it once.  The mean value of the "sequence" of
> > numbers generated by that roll is whatever number came up on the die -- but
> > the theoretical mean is 3.5.  That's not achievable with one roll of that
> > standard die.  Even if you choose to roll that die a large odd number of
> > times, you will never be able to achieve the theoretical mean of that number
> > of rolls as all the numbers on the die are integers.
> >
> > If that argument doesn't work, then point him to Wikipedia (particularly the
> > second example on this page):
> >
> > http://en.wikipedia.org/wiki/Law_of_averages
> >
> > If nothing else that should occupy him for a few hours following links to
> > interesting topics :)
> >
> > --
> > Steve Lord
> > sl...@mathworks.com
> > comp.soft-sys.matlab (CSSM) FAQ:http://matlabwiki.mathworks.com/MATLAB_FAQ
> > To contact Technical Support use the Contact Us link onhttp://www.mathworks.com
>
>
> hey,
>
> just to have fun being technical:
>
> in theory, the mean of a set of numbers generated using randn *is a
> random variable with a distribution centered at zero*, whose standard
> deviation tightens as you increase the size of the set. in the limit
> of infinite numbers in the set, the probability density function
> becomes a delta function at zero (probability 1).
>
> wouldn't be worth mentioning except you're implying a difference
> between theory and practice that doesn't exist. actually, in theory,
> you will NEVER get exactly zero with a finite set of numbers (because
> you're integrating the probability density function "from zero to
> zero").
>
> artur: the true statement would be "for white noise, the EXPECTED mean
> is zero." also, if I'm understanding you right re: "gaussian curve
> values", use normpdf() or mvnpdf().

ok merci for this...but finaly how can i generate a white gaussian noise in matlab version 2009, becouse in this version i don't have the function WGN or AWGN
thnak you,
Artur

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: Bruno Luong

Date: 26 May, 2010 21:38:04

Message: 23 of 27

.. If mean(randn(10,1)) is 0 (as Artur's boss claim),
then mean(randn(9,1)) should also be 0 (why not),
etc, ...
..
mean(randn(2,1)) is also 0
mean(randn(1,1)) is also 0, therefore randn(1,1) would be 0 (I hope you still follow).

Conclusion any Gaussian random process is a 0-delta function. Statistics would be easy like a toy game. Any noise vanishes, all measurement are infinity accurate, good does not play dice, the world will be perfect, and the peace is for all.

I say no one can fire Artur's boss.

Bruno

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: Artur Artur

Date: 26 May, 2010 21:38:04

Message: 24 of 27

TideMan <mulgor@gmail.com> wrote in message <d34de8f8-c5f2-4b8c-ba8f-0e03707ab1a9@s1g2000prf.googlegroups.com>...
> I think I've come up with the perfect sop for Artur's boss who doesn't
> like the mean of 10 random numbers not being exactly zero.
> round(mean(randn(10,1)))

for me this are just truckies(becouse it doesn't met the white noise definition)

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: Artur Artur

Date: 26 May, 2010 21:41:04

Message: 25 of 27

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <htk4bs$ivo$1@fred.mathworks.com>...
> .. If mean(randn(10,1)) is 0 (as Artur's boss claim),
> then mean(randn(9,1)) should also be 0 (why not),
> etc, ...
> ..
> mean(randn(2,1)) is also 0
> mean(randn(1,1)) is also 0, therefore randn(1,1) would be 0 (I hope you still follow).
>
> Conclusion any Gaussian random process is a 0-delta function. Statistics would be easy like a toy game. Any noise vanishes, all measurement are infinity accurate, good does not play dice, the world will be perfect, and the peace is for all.
>
> I say no one can fire Artur's boss.
>
> Bruno


nice nice Bruno :)

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: Bruno Luong

Date: 27 May, 2010 18:03:10

Message: 26 of 27

Walter Roberson <roberson@hushmail.com> wrote in message <htjukj$giq$1@canopus.cc.umanitoba.ca>...
> Bruno Luong wrote:
> > Anyone <""Zrqt\"@³@Qi§QUm![§H:\"&z25u/g`MpEr)\"{ETq[opZ\"Vz.az?"> wrote
> > in message <4bfd77cd$0$32006$c3e8da3@news.astraweb.com>...
>
> >> >> mean(randn(100000000,1))
>
> > Did someone mention this is a rich and slow way of doing
> >>> randn/10000
>
> No it isn't. By the Law Of Large Numbers, mean(randn(N,1)) for large N will
> have a much lower mean and standard deviation than randn(1,1)/sqrt(N) will.

Yes, of course it is!

It is a well known that linear map of Gaussian multivariate vectors is an Gaussian. For the map X -> Y=L*X, where L is any matrix, and the expectation and the variance of Y can be computed according to the formulas:

1) E(Y) = L*E(X);
2) E(Y*Y') = L*E(X*X)'*L'.

Let X = (X1, ..., Xn) where Xi ~ N(0,1) and and {Xi} are independent; in other word E(X*X') = eye(n).

For Yn the "mean" of X, i.e.:
Yn := (1/n, .., 1/n) * X, then

E(Y) = L*0 = 0
E(Y*Y') = n*(1/n^2) = 1/n.

So Y is Gaussian having 0-mean and standard deviation = sqrt(E(Y^2)) = 1/sqrt(n). This formula is exact, not approximate.

This is fortunately 100% compatible with the Central Limit Theorem. Indeed, according to: http://en.wikipedia.org/wiki/Central_limit_theorem

Zn := (X1 + ... + Xn)/sqrt(n) -> N(0,1)

Because Zn is Yn*sqrt(n); Yn must have standard deviation ~ 1/sqrt(n) for n -> infinity. Yn can't have standard deviation "much lower" than 1/sqrt(n) as you claimed Walter.

Bruno

Subject: how can i generate a White Gaussian Noise in Matlab 2009

From: David Young

Date: 27 May, 2010 18:12:06

Message: 27 of 27

"Artur Artur" <arturracu@yahoo.com> wrote in message <htk44c$4fq$1@fred.mathworks.com>...
> ...
> ok merci for this...but finaly how can i generate a white gaussian noise in matlab version 2009, becouse in this version i don't have the function WGN or AWGN
> ...

Well I guess my original answer got lost in the noise, but it's still valid: use randn.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us