[PD] Box Muller Gaussian noise

Martin Peach martin.peach at sympatico.ca
Sun Mar 16 17:16:49 CET 2008


Andy Farnell wrote:
> Could a stats mathematician please help me check this. (attached) 

Well I'm not one but...

> 
> I'm following the Box Muller formula for getting  a cheap Gaussian 
> distribution (instead of adding up 12 sources a la central limit method).
> 
> http://www.dspguru.com/howto/tech/wgn.htm
> 
> Does this look right?
> 
> Also, I have no idea how to check the distribution. It sounds the same as
> uniform noise and looks the same in the spectrograph? What gives?
> Do I need to average over a very long time or something to see any
> difference?

The way I understand it, white noise has the characteristic that if you 
count the number of occurrences of each possible value they will be 
normally distributed (the bell curve, with most values being near the 
peak, since all values are equally probable) with any particular value 
being located at random on the curve -- there is no correlation between 
a given value and its probability of occurrence.

Gaussian noise is distributed so that the values themselves follow the 
bell curve with the extreme values at the tails of the curve and the 
median values in the middle (on average of course, any given trial can 
give weird results).

So, to check your distribution you could write some values to a table 
and then bin them according to value to see if the points around zero 
occur a lot more often than the points near one and minus one.

I tried your patch with [noise~] and [gaussianoise] writing to tables 
and visually compared the results and it's true you can't hear the 
difference but you can definitely see it.

(gaussianoise has occasional values that exceed [-1 ... 1], which I 
suppose is normal...white noise is always on [-1...1])

With white noise there should be no preferred values but gaussian noise 
will have a lot more hovering around zero.

Martin



> 
> Cheers all,
> 
> Andy
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list




More information about the Pd-list mailing list