[PD] Random - Different seed each time the patch is loaded

Martin Peach martin.peach at sympatico.ca
Fri Sep 5 15:23:06 CEST 2008

Charles Henry wrote:
> On Thu, Sep 4, 2008 at 5:09 PM, Peter Plessas <plessas at mur.at> wrote:
>> * Charles Henry <czhenry at gmail.com> [2008-09-04 23:53]:
>>> On Thu, Sep 4, 2008 at 4:29 PM, Peter Plessas <plessas at 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.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: random_from_adc.pd
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20080905/a8cf8a13/attachment.asc>

More information about the Pd-list mailing list