[PD] Box Muller Gaussian noise
marius schebella
marius.schebella at gmail.com
Sun Mar 16 20:43:34 CET 2008
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: noise-distr.pd
Type: application/x-extension-pd
Size: 4691 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20080316/6dfbae5e/attachment.bin>
More information about the Pd-list
mailing list