Newsgroups: comp.speech
Path: pavo.csi.cam.ac.uk!warwick!zaphod.crihan.fr!pipex!uunet!zaphod.mps.ohio-state.edu!howland.reston.ans.net!darwin.sura.net!ra!macker@itd.nrl.navy.mil
From: macker@itd.nrl.navy.mil (Joseph P. Macker)
Subject: Re: Source program for generating Gaussian, Laplacian or Gauss-Markov sourc
Message-ID: <C70rGw.L8I@ra.nrl.navy.mil>
Sender: usenet@ra.nrl.navy.mil
Organization: US Naval research Lab
References: <sliawati.737364113@scorpion.ac.cowan.edu.au>
Date: Fri, 14 May 1993 13:43:42 GMT
Lines: 48


A simple way to generate a gaussian source can be used, based upon the law of large
number.

First you must generate a uniform pdf source between (0,1).  This can be easily approximated by
using a maximal length linear shift register or something as simple as a C library 
Rand() function with the appropriate seed value.

Then the following approximation can be used.

"If U1,U2,...Un is a sequence of n uniform random deviates,
then Xn = (sum(Ui)-n/2)*sqrt(n/12) is asymptotically distributed as a normal
random deviate."

This basically says that the you can take a set of n independent random
numbers and use the formula Xn to produce one gaussian variable.  The larger the
number n the closer the approximation is to a normal distribution.  This also relies
on the fact that your uniform random number source also performs in a truly uniform
fashion.

I have used the following approach on 16-bit machines.

Uniform distribution:

Ivar(n)=(J*Ivar(n-1)+constant) mod 65535.

The numbers for J and constant should be choosen to give good uniform results.

Generate 12 numbers using Ivar(n).

Use Xn equation which for n=12 is simplified to Xn=sum(Ivar(i))-6.

This produces a gaussian pdf approximation between (-6,6).

You of course would want to scale numbers, calculations, and accuracies to your 
own requirements.  Also, there are other Gaussian approximations which are more accurate, but these are
generally more complicated to process. Math reference books have more algorithms.

Hope this is helpful.



> 	Would somebody tell me about the formula or perhap the algorithm for
> generating Gaussian, Laplacian or Gauss-Markov sources. So, I can make progam
> to generate them.
> 	Thank you very much in advance.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

