[sdiy] Best software noise algorithm?

Eric Brombaugh ebrombaugh1 at cox.net
Wed Feb 17 19:15:01 CET 2010


On 02/17/2010 11:01 AM, Tom Wiltshire wrote:
> Hi All,
>
> What's the most efficient software pseudo-random noise algorithm?
>
> I have previously used LFSRs, which are reasonably quick and can produce
> very long sequences quite easily, but I'm looking for something really
> quick and dirty.
>
> I looked into Linear Congruential Generators, and found lots of sites
> that said that these can be very quick if you ensure the modulus is a
> power of two. But most examples are actually with the Parks-Miller
> numbers, which aren't a power of two.
>
> I'll be doing this in dsPIC assembly as usual, and I've currently got a
> 64-bit LFSR that generates a new 16-bit number in 19 cycles. The quality
> and sequence length of that are more than I really need, so I'd like to
> speed it up.
>
> Have people got any good tricks to share for making random numbers
> quickly ?

Tom,

You're using a dsPIC33FJ64GP802 right?

Take a look at the on-chip peripherals. Notice that CRC generator? 
That's basically an LFSR that can be seeded. Can you think of how that 
might be useful?

Just a hint... :)

Eric



More information about the Synth-diy mailing list