[PD] Box Muller Gaussian noise

Andy Farnell padawan12 at obiwannabe.co.uk
Sun Mar 16 21:23:53 CET 2008



GEM is broken here, but thanks for the info Marius. 
I'm reading through the docs for R at the moment.
It makes lovely plots, but haven't figured how to get
my data in to it yet...

JFYI the application is rainfall. Many papers I read describe
rainfall as Gaussian.

I know from physical analysis that raindrops are uniform in size
and velocity for any local sample, so I've realised this distribution
is about how they fall within an area and pondering how a 
distribution can be Gaussian in 2D. 

Thing is, I can't figure out any good reason why rain should
by anything other than uniformly distributed ! :(

When I use Martins second patch with a thresholding function
to trigger droplet sounds, it does sound a lot more like
real rainfall than a uniformly triggered model.

I'm in one of those grey areas where I half understand what I'm
doing, which is a dangerous place to be. 

Anybody know of cool papers I might have missed on the
distribution of rain drops and the effect on their sound?

Thanks,

Andy




On Sun, 16 Mar 2008 15:43:34 -0400
marius schebella <marius.schebella at gmail.com> wrote:

> from the first equation that andy posted, I produced a gem 
> representation. the box muller noise seems wrong, because it does not 
> use the whole range but is shifted to the negative side.
> note, this is not a distribution of frequencies, but of noise values..
> marius.
> 
> Martin Peach wrote:
> > Oh no that's wrong isn't it :(
> > The log is necessary to keep the distribution normal, and the range is 
> > going to get wider the closer to zero the radius is allowed to get.
> > The attached patch has a scale adjustment...
> > Still I wonder what kind of distribution gaussianoise2 gives, it's not 
> > just white.
> > 
> > Martin
> > 
> > 
> > Martin Peach wrote:
> >> Charles Henry wrote:
> >>> On Sun, Mar 16, 2008 at 11:16 AM, Martin Peach
> >>> <martin.peach at sympatico.ca> wrote:
> >>>>  (gaussianoise has occasional values that exceed [-1 ... 1], which I
> >>>>  suppose is normal...white noise is always on [-1...1])
> >>>
> >>> That's true.  With the Box-Muller method, there is the log(~U1) term,
> >>> but you can always just add a small value to U1, which will truncate
> >>> your distribution.  The size of the small value can be calculated to
> >>> fit with any given threshold.
> >>>
> >>
> >> I think it's really because the Box-Muller method selects random 
> >> numbers  in pairs which map to points in a unit square on the plane, 
> >> but then selects only those points which are inside the unit circle, 
> >> something that the pd patch doesn't do (how to resample points in a 
> >> dsp vector until they are in range?). The attached patch shows the 
> >> straightforward way of doing it by simply selecting a random radius 
> >> and angle and returning the resulting y coordinate as the random 
> >> number. The results are always on [-1,1].
> >> I don't think sin~ will be any slower than log~.
> >>
> >> Martin
> >>
> >>
> >> ------------------------------------------------------------------------
> >>
> >> _______________________________________________
> >> PD-list at iem.at mailing list
> >> UNSUBSCRIBE and account-management -> 
> >> http://lists.puredata.info/listinfo/pd-list
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > _______________________________________________
> > PD-list at iem.at mailing list
> > UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
> 
> 


-- 
Use the source




More information about the Pd-list mailing list