Charles Henry wrote:
On Thu, Sep 4, 2008 at 5:09 PM, Peter Plessas plessas@mur.at wrote:
- Charles Henry czhenry@gmail.com [2008-09-04 23:53]:
On Thu, Sep 4, 2008 at 4:29 PM, Peter Plessas plessas@mur.at wrote:
Perhaps i am getting you wrong, but if i would want different behavior each time i'd open that patch, the noise from your adc~ would do that, bc it is surely different (thermal noise, etc) every time. (provided you switched your dsp~ on in advance). :-)
That is right, for really large numbers and critical applications the noise from the soundcard might not be white enough!
Actually, it's not the whiteness of the noise which is important. Whiteness of noise simply means that the samples are not correlated with each other with respect to time. The key is the distribution of a random variable, namely the instantaneous value of the noise at a single point in time.
Since the noise values tend to be close to 0, the values are un-evenly distributed. I'm really just pointing to the advantage of using a uniformly distributed random variable for choosing seeds.
Of course, now that you have me thinking about it :) , we could transform our distribution for the noise into a uniform distribution, like using the Box-Muller method backwards.
Attached is a patch that takes a low order bit from the sampled adc every 10 milliseconds to make a 16-bit number from 16 successive bits. Then it fills a table with 1000000 such numbers. After letting it run all night, this morning I had an array that certainly _sounds_ white. It would be interesting to run some tests on it. The sound card input was not connected to anything. The choice of which bit to sample is important and probably varies among sound cards.
Martin
#N canvas 778 48 352 556 10; #X obj 77 120 adc~; #X obj 76 144 snapshot~; #X obj 136 47 metro 10; #X obj 163 107 f; #X obj 197 90 + 1; #X obj 10 -11 sel 1; #X msg 10 8 0; #X msg 178 67 0; #X obj 76 185 i; #X obj 76 225 == 0; #X obj 76 205 & 4; #X obj 76 164 * 32768; #X obj 136 0 t f b; #X msg 136 -20 1; #X obj 199 160 expr pow(2 , $f1); #X obj 119 242 *; #X obj 136 67 t b b; #X obj 119 284 f; #X obj 119 263 +; #X floatatom 119 312 7 0 0 0 - - -; #X obj 10 -31 >= 15; #X obj 207 -37 metro 1000; #X obj 207 -57 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1; #X obj 90 315 f; #X obj 10 30 t f b; #X obj 190 132 t f f; #X obj 37 245 delay 10; #X obj 90 342 tabwrite pig; #X obj 207 277 f; #X obj 241 260 + 1; #X floatatom 207 298 5 0 0 0 - - -; #X obj 228 420 /~ 65536; #X obj 227 457 dac~; #X obj 228 399 tabread4~ pig; #X obj 230 358 phasor~; #X floatatom 230 339 5 0 0 0 - - -; #X floatatom 280 358 5 0 0 0 - - -; #X floatatom 264 -58 5 0 0 0 - - -; #X obj 229 378 *~ 100000; #X obj 241 279 % 100000; #X obj 90 362 table pig 100000; #X connect 0 0 1 0; #X connect 1 0 11 0; #X connect 2 0 16 0; #X connect 3 0 4 0; #X connect 3 0 25 0; #X connect 4 0 3 1; #X connect 5 0 6 0; #X connect 6 0 24 0; #X connect 7 0 17 0; #X connect 7 0 3 1; #X connect 8 0 10 0; #X connect 9 0 15 0; #X connect 10 0 9 0; #X connect 11 0 8 0; #X connect 12 0 2 0; #X connect 12 1 7 0; #X connect 13 0 12 0; #X connect 14 0 15 1; #X connect 15 0 18 0; #X connect 16 0 1 0; #X connect 16 1 3 0; #X connect 17 0 18 1; #X connect 17 0 19 0; #X connect 17 0 23 1; #X connect 18 0 17 0; #X connect 20 0 5 0; #X connect 21 0 13 0; #X connect 21 0 28 0; #X connect 22 0 21 0; #X connect 23 0 27 0; #X connect 24 0 2 0; #X connect 24 1 26 0; #X connect 25 0 20 0; #X connect 25 1 14 0; #X connect 26 0 23 0; #X connect 28 0 29 0; #X connect 28 0 30 0; #X connect 28 0 27 1; #X connect 29 0 39 0; #X connect 31 0 32 0; #X connect 31 0 32 1; #X connect 33 0 31 0; #X connect 34 0 38 0; #X connect 35 0 34 0; #X connect 36 0 38 1; #X connect 37 0 21 1; #X connect 38 0 33 0; #X connect 39 0 28 1;