Here's a histogram generator (binner) that shows the distribution of [gaussianoise]. Using it I can quickly see that [gaussianoise2] is too peaked around zero and that [gaussianoise3] chops the tails off when the scale is low. If you have uniformly distributed raindrops falling, any given area will receive a number of raindrops that clusters about the mean in a normal distribution, just as if you first bin the number of occurrences of each value of white noise, then bin the resulting counts, the histogram of the counts will look like a bell curve centered at the mean count.

Martin

Andy Farnell wrote:

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 <[EMAIL PROTECTED]> 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
<[EMAIL PROTECTED]> 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@iem.at mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list

------------------------------------------------------------------------

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




#N canvas 318 170 625 753 10;
#X obj -243 -312 tabread bbb;
#X obj -243 -376 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1
0 1;
#X obj -243 -290 moses 0;
#X obj -243 -334 f;
#X obj -219 -334 + 1;
#X obj -195 -334 sel 100;
#X msg -146 -334 0;
#X obj -204 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -257985
-13381 -1 12700 1;
#X obj -189 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4034
-13381 -1 12700 1;
#X obj -174 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4034
-13381 -1 12700 1;
#X obj -159 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4034
-13381 -1 12700 1;
#X obj -144 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4034
-13381 -1 12700 1;
#X obj -129 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4034
-13381 -1 12700 1;
#X obj -114 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4034
-13381 -1 12700 1;
#X obj -99 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4034
-13381 -1 12700 1;
#X obj -84 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4034
-13381 -1 12700 1;
#X obj -243 -269 * -1;
#X obj -69 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4034
-13381 -1 0 1;
#X obj -204 -261 bin 0.1;
#X obj -101 -340 s reset;
#X obj -101 -361 bng 15 250 50 0 empty empty empty 17 7 0 10 -4034
-13381 -1;
#X obj -189 -241 bin 0.2;
#X obj -174 -220 bin 0.3;
#X obj -159 -199 bin 0.4;
#X obj -144 -179 bin 0.5;
#X obj -129 -159 bin 0.6;
#X obj -114 -139 bin 0.7;
#X obj -99 -118 bin 0.8;
#X obj -54 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4032
-13381 -1 0 1;
#X obj -39 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4032
-13381 -1 0 1;
#X obj -24 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4032
-13381 -1 0 1;
#X obj -9 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4032
-13381 -1 0 1;
#X obj 6 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4032
-13381 -1 0 1;
#X obj 21 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4032
-13381 -1 0 1;
#X obj 36 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4032
-13381 -1 0 1;
#X obj 51 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4032
-13381 -1 0 1;
#X obj 66 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4032
-13381 -1 0 1;
#X obj 81 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4032
-13381 -1 0 1;
#X obj -219 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -257985
-13381 -1 12700 1;
#X obj -234 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4034
-13381 -1 12700 1;
#X obj -249 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4034
-13381 -1 12700 1;
#X obj -264 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4034
-13381 -1 12700 1;
#X obj -279 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4034
-13381 -1 12700 1;
#X obj -294 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4034
-13381 -1 12700 1;
#X obj -309 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4034
-13381 -1 12700 1;
#X obj -324 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4034
-13381 -1 12700 1;
#X obj -339 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4034
-13381 -1 12700 1;
#X obj -354 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4034
-13381 -1 300 1;
#X obj -219 -199 bin 0.1;
#X obj -234 -179 bin 0.2;
#X obj -249 -159 bin 0.3;
#X obj -264 -139 bin 0.4;
#X obj -279 -119 bin 0.5;
#X obj -294 -99 bin 0.6;
#X obj -309 -79 bin 0.7;
#X obj -324 -59 bin 0.8;
#X obj -369 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4032
-13381 -1 0 1;
#X obj -384 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4032
-13381 -1 0 1;
#X obj -399 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4032
-13381 -1 0 1;
#X obj -414 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4032
-13381 -1 0 1;
#X obj -429 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4032
-13381 -1 0 1;
#X obj -444 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4032
-13381 -1 0 1;
#X obj -459 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4032
-13381 -1 0 1;
#X obj -474 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4032
-13381 -1 0 1;
#X obj -489 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4032
-13381 -1 0 1;
#X obj -504 210 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -4032
-13381 -1 0 1;
#X obj -84 -95 bin 0.9;
#X obj -69 -77 bin 1;
#X obj -54 -55 bin 1.1;
#X obj -39 -35 bin 1.2;
#X obj -24 -14 bin 1.3;
#X obj -9 6 bin 1.4;
#X obj 6 26 bin 1.5;
#X obj 21 46 bin 1.6;
#X obj 36 67 bin 1.7;
#X obj 51 87 bin 1.8;
#X obj 66 109 bin 1.9;
#X obj 81 129 bin 2;
#X obj -339 -39 bin 0.9;
#X obj -354 -19 bin 1;
#X obj -369 1 bin 1.1;
#X obj -384 21 bin 1.2;
#X obj -399 41 bin 1.3;
#X obj -414 61 bin 1.4;
#X obj -429 81 bin 1.5;
#X obj -444 101 bin 1.6;
#X obj -459 121 bin 1.7;
#X obj -474 141 bin 1.8;
#X obj -489 163 bin 1.9;
#X obj -504 183 bin 2;
#X obj -243 -356 metro 1;
#X obj -448 -204 tabwrite~ bbb;
#X obj -438 -237 table bbb;
#X obj -448 -259 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X text -432 -261 write to table;
#X obj -367 -360 metro 100;
#X obj -367 -335 delay 10;
#X obj -367 -375 tgl 15 0 empty empty make_histogram 17 7 0 10 -4034
-13381 -13381 0 1;
#X obj -461 -302 gaussianoise;
#X connect 0 0 2 0;
#X connect 1 0 90 0;
#X connect 2 0 16 0;
#X connect 2 1 18 0;
#X connect 3 0 4 0;
#X connect 3 0 0 0;
#X connect 4 0 5 0;
#X connect 5 0 6 0;
#X connect 5 1 3 1;
#X connect 6 0 3 1;
#X connect 6 0 1 0;
#X connect 16 0 48 0;
#X connect 18 0 7 0;
#X connect 18 1 21 0;
#X connect 20 0 19 0;
#X connect 21 0 8 0;
#X connect 21 1 22 0;
#X connect 22 0 9 0;
#X connect 22 1 23 0;
#X connect 23 0 10 0;
#X connect 23 1 24 0;
#X connect 24 0 11 0;
#X connect 24 1 25 0;
#X connect 25 0 12 0;
#X connect 25 1 26 0;
#X connect 26 0 13 0;
#X connect 26 1 27 0;
#X connect 27 0 14 0;
#X connect 27 1 66 0;
#X connect 48 0 38 0;
#X connect 48 1 49 0;
#X connect 49 0 39 0;
#X connect 49 1 50 0;
#X connect 50 0 40 0;
#X connect 50 1 51 0;
#X connect 51 0 41 0;
#X connect 51 1 52 0;
#X connect 52 0 42 0;
#X connect 52 1 53 0;
#X connect 53 0 43 0;
#X connect 53 1 54 0;
#X connect 54 0 44 0;
#X connect 54 1 55 0;
#X connect 55 0 45 0;
#X connect 55 1 78 0;
#X connect 66 0 15 0;
#X connect 66 1 67 0;
#X connect 67 0 17 0;
#X connect 67 1 68 0;
#X connect 68 0 28 0;
#X connect 68 1 69 0;
#X connect 69 0 29 0;
#X connect 69 1 70 0;
#X connect 70 0 30 0;
#X connect 70 1 71 0;
#X connect 71 0 31 0;
#X connect 71 1 72 0;
#X connect 72 0 32 0;
#X connect 72 1 73 0;
#X connect 73 0 33 0;
#X connect 73 1 74 0;
#X connect 74 0 34 0;
#X connect 74 1 75 0;
#X connect 75 0 35 0;
#X connect 75 1 76 0;
#X connect 76 0 36 0;
#X connect 76 1 77 0;
#X connect 77 0 37 0;
#X connect 78 0 46 0;
#X connect 78 1 79 0;
#X connect 79 0 47 0;
#X connect 79 1 80 0;
#X connect 80 0 56 0;
#X connect 80 1 81 0;
#X connect 81 0 57 0;
#X connect 81 1 82 0;
#X connect 82 0 58 0;
#X connect 82 1 83 0;
#X connect 83 0 59 0;
#X connect 83 1 84 0;
#X connect 84 0 60 0;
#X connect 84 1 85 0;
#X connect 85 0 61 0;
#X connect 85 1 86 0;
#X connect 86 0 62 0;
#X connect 86 1 87 0;
#X connect 87 0 63 0;
#X connect 87 1 88 0;
#X connect 88 0 64 0;
#X connect 88 1 89 0;
#X connect 89 0 65 0;
#X connect 90 0 3 0;
#X connect 93 0 91 0;
#X connect 95 0 93 0;
#X connect 95 0 96 0;
#X connect 96 0 1 0;
#X connect 97 0 95 0;
#X connect 98 0 91 0;
#N canvas 773 84 262 273 10;
#X obj 103 68 inlet;
#X obj 103 184 outlet;
#X obj 148 184 outlet;
#X obj 103 91 moses \$1;
#X obj 103 138 f;
#X obj 125 138 + 1;
#X obj 46 91 r reset;
#X msg 46 121 0;
#X obj 103 114 b;
#X connect 0 0 3 0;
#X connect 3 0 8 0;
#X connect 3 1 2 0;
#X connect 4 0 5 0;
#X connect 4 0 1 0;
#X connect 5 0 4 1;
#X connect 6 0 7 0;
#X connect 7 0 4 0;
#X connect 8 0 4 0;
_______________________________________________
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list

Reply via email to