[sdiy] Uniformly distributed noise generator?
Tom Wiltshire
tom at electricdruid.net
Mon Jun 17 14:32:37 CEST 2013
If you're careful about the design of your LFSR, you can get considerable savings by setting things up to do multiple shifts at once like this, at least for software LFSRs.
Let's say we've got a 32-bit LFSR and we want a 8-bit random byte. We could shift the LFSR a single bit 8 times, which gives us 8 "clean" bits to use for our random byte. This is fairly slow.
The quicker way is to do a combined 8-bit shift, so we can move the bytes of the register along one place, rather than having to use shifts, and stick the XORd byte in the bottom. This gives a good efficiency saving, but involves finding tap sequences that won't get screwed up by the combined shifting operation.
There's a PIC ASM example on my website:
http://www.electricdruid.net/index.php?page=techniques.practicalLFSRs
T.
On 17 Jun 2013, at 12:52, rsdio at sounds.wa.com wrote:
> Thanks for the clarification, Richie.
>
> A good solution for the problem described is to run the binary noise source
> multiple times so that all bits are fresh each time. If you want a 16-bit noise
> sample, then run the shift and XOR operation 16 times before grabbing 16 bits.
> You can use a noise source of any length, and pull any number of bits out of it
> provided that you avoid taking "all" of the bits. For a 24-bit bit noise sample
> you could run the noise source through 24 iterations between each use. This way
> all the bits are random, not just one. I assume that the spectrum would be flat
> in this manner.
>
> Brian
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at dropmix.xs4all.nl
> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
More information about the Synth-diy
mailing list