Re: white noise generation
- From: "John E. Hadstate" <jh113355@xxxxxxxxxxx>
- Date: Sun, 6 Jul 2008 09:04:38 -0400
"Jerry Avins" <jya@xxxxxxxx> wrote in message news:p_udnbalrN_LWvPVnZ2dnUVZ_qHinZ2d@xxxxxxxxxx
John E. Hadstate wrote:
...
Either an LFSR or an Xorshift PRNG, with suitable choice of parameters, will generate every possible bit pattern in a group of bits exactly once before repeating the sequence. Thus, uniform distribution is the only possibility.
That's true, but possibly misleading. All zeros (all ones in some implementations) is not a possible bit pattern, so there is a small bias that can be made evident by integration.
The usable output of the LFSR is a single bit per clock (not the whole shift register). A maximal-length N-bit LFSR will generate ((2**N)-1) bits before the sequence repeats. Since 2**N-1 is an odd number, there must always be more zeroes than ones or vice versa in the output, producing the small bias to which you referred.
On the assumption that consecutive bits are uncorrelated, there is an algorithm called the "Von Neumann Corrector" that will remove this bias at the expense of discarding some of the original bits. (This algorithm can also be applied to hardware sources of random numbers, like radioactive decay, which, for one reason or another, may exhibit bias.)
The Von Neumann Corrector algorithm works on pairs of consecutive bits, and produces output as follows:
1.. If the input is "00" or "11", the input is discarded (no output).
2.. If the input is "10", output a "1".
3.. If the input is "01", output a "0".
Further information is available at
http://everything2.com/index.pl?node_id=1467753
and
http://www.helsbreth.org/random/removing_bias.html
.
- References:
- white noise generation
- From: esfield
- Re: white noise generation
- From: John E. Hadstate
- Re: white noise generation
- From: Jerry Avins
- white noise generation
- Prev by Date: Re: FM Demodulation
- Next by Date: Re: LMS algorithm implementation
- Previous by thread: Re: white noise generation
- Next by thread: Digital IIR Filters from S-Domain Transfer Functions
- Index(es):
Relevant Pages
|