Re: [linux-audio-dev] ANN: libgdither 0.6

From: Steve Harris <S.W.Harris@email-addr-hidden>
Date: Tue Jul 26 2005 - 11:45:45 EEST

On Mon, Jul 25, 2005 at 08:56:49 +0200, fons adriaensen wrote:
> On Mon, Jul 25, 2005 at 07:37:14PM +0200, Wolfgang Woehl wrote:
>
> > Me being noisy all the time I still don't know the maths of making
> > noise. Would you care to explain the rationale in this snippet from
> > noise.h?
> >
> > inline static float gdither_noise()
> > {
> > static uint32_t rnd = 23232323;
> > rnd = (rnd * 196314165) + 907633515;
> > return rnd * 2.3283064365387e-10f;
> > }
>
> It's a 'linear congruential sequence generator', one of the simplest
> and fastest ways to generate uniform random variables. For a (very
> complete) analysis of this algorithm, see D.E. Knuth, "The Art of
> Computer Programming", Vol.2. The final multiply reduces the output
> to the interval [0,1].

Thanks :) Yes, note that its not much good as a random number generator as
its easily predictable, but in this case all thats required is that it
produces noise that is approximatly white (ie. equal energy in each
frequency band), and its efficient. This is the fallback generator, and
the calling application can provide its own at compile time, but it seems
reasonable according to the test processes.

- Steve
Received on Tue Jul 26 12:15:09 2005

This archive was generated by hypermail 2.1.8 : Tue Jul 26 2005 - 12:15:09 EEST