Attila Kinali attila at kinali.ch
Mon Oct 29 09:59:08 EDT 2018

```Moin,

I'm bunching a few mails together, to not clutter the mailinglist too much

On Sat, 27 Oct 2018 23:25:30 +0200
Magnus Danielson <magnus at rubidium.dyndns.org> wrote:

> The integration is very important aspect, as a number of assumptions
> becomes embedded into it, such as the f_H frequency which is the Nyquist
> frequency for counters, so sampling interval is also a relevant
> parameter for expected level.

An important thing to note here is that Gaussian white noise is,
as it is defined, non-continuous (by any continuity measure).
Ie if you take two samples, no matter how close they are time-wise,
their difference in value can be arbitrary large. If you are integrating
over (time-continuous) Gaussian white noise, you have to argue
carefully, why this integral is defined (meaning why calculating it
leads to a single, well defined value). In our case, it's usually
enough to assume that there is a finite cut-off frequency at which
point the signal falls off with at least 1/f^2 (or >=40dB/dec) to
ensure 1) continuity and 2) convergence of the integral.

For more details, see a textbook on Ito-calculus, e.g. [1]

On Sat, 27 Oct 2018 23:43:33 +0200
Magnus Danielson <magnus at rubidium.dyndns.org> wrote:

> A simple trick to transform uniform distribution to normal distribution
> like shape is to take 12 samples and add them together. A special trick
> is to take them pair-wise and subtract them and then add 6 differences,
> to avoid DC bias of typical uniform distribution generation (as typical
> pseudo-noise generators does not have all 0 state in them). The result
> of this subtract-add trick is a normal distribution like thing with the
> standard distribution of 1. More or fewer sample-pairs can be added if
> the product is scaled appropriately.
>
> The Box-Mueller algorithm is another way to convert uniform distribution
> to normal distribution.

as an approach for generating normal distributed values! Even if it will
get you something that looks like a normal distribution, it's quite far
from it. It is also a very slow method and uses up a lot of randomnes.

Box-Müller is a usable alternative, though I would recommend using
the Ziggurat Method[2], which is very fast and leads to a very good
approximation. When I replaced the "take 30 samples and add them" of
François Vernotte's Sigmatheta package[3] and used the Ziggurat Method,
combined with xorshift1024*[4] for random number generation, I got
a total speed up of a factor of more than 2 (including the FFT and
everything)[5] (yes, I know that xorshift1024* does have some problems
in the quality of random numbers generated, but they shouldn't be
relevant for the application at hand).

Attila Kinali

[1] "Stochastic Differential Equations", by Bernt Øksendal, 2013 (6th ed)

[2] "The Ziggurat Method for Generating Random Variables",
by Marsaglia and Tsang, 2000
http://dx.doi.org/10.18637/jss.v005.i08

[3] https://theta.obs-besancon.fr/spip.php?article103&lang=fr

[4] http://xoshiro.di.unimi.it/
or more specifically: http://xoroshiro.di.unimi.it/xorshift1024star.c

[5] https://git.kinali.ch/attila/sigmatheta
--
It is upon moral qualities that a society is ultimately founded. All
the prosperity and technological sophistication in the world is of no
use without that foundation.
-- Miss Matheson, The Diamond Age, Neal Stephenson

```