[sdiy] Best software noise algorithm?
Scott Gravenhorst
music.maker at gte.net
Wed Feb 17 19:08:26 CET 2010
Tom Wiltshire <tom at electricdruid.net> 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 ?
>
I'm an LFSR freak...
http://home1.gte.net/res0658s/electronics/LFSRtaps.html
The above is a table of taps for maximal LFSRs, some require only 2 taps. The
execution time, I assume, depends on the number of XOR operations (among other
things) so to reduce the taps is to speed it up.
I like Eric's idea of using an internal CRC generator if it's got enough bits.
I also like Dave's idea of adding an FPGA.
Also - Could a CPLD do this?
As long as the topic is noise algorithms - see this thread wherein there are some
samples of an FPGA noise synth I'm working on:
http://electro-music.com/forum/viewtopic.php?p=284333#284333
The synth is implemented on the little Avnet Spartan-3A dev board.
-- ScottG
________________________________________________________________________
-- Scott Gravenhorst
-- FPGA MIDI Synthesizer Information: home1.gte.net/res0658s/FPGA_synth/
-- FatMan: home1.gte.net/res0658s/fatman/
-- NonFatMan: home1.gte.net/res0658s/electronics/
-- When the going gets tough, the tough use the command line.
More information about the Synth-diy
mailing list