[sdiy] Pseudo Random Noise Generator in an AVR?

Magnus Danielson magnus at rubidium.dyndns.org
Thu Jan 10 05:12:58 CET 2013


Hi!

On 01/09/2013 08:00 PM, Matthew Smith wrote:
> For what it's worth, this generates C templates:
>
> http://lfsr-generator.sourceforge.net/
>
> ...used in combination with a taps list:
>
> http://home1.gte.net/res0658s/electronics/LFSRtaps.html
>
> As an alternative, and if you have space for a further device on the
> board and already have a high speed clock line, it's a trivial exercise
> to implement an LFSR in a CPLD. I've got some Verilog for it, kicking
> around somewhere.
>

You want a sufficiently long polynomial. The reason is because the loop 
time of the sequence will be noticeable if it comes quick. Some of the 
early synths with random noise generator chips had audible clicks in 
them, because the sequence was too short. You can balance length with 
rate to some degree, but you loose the high end properties by slowing it 
down. However, it is relatively cheap to make it much longer, so you 
need to find a nice set of feedback taps to have the Maximum Length 
Sequence property (needs to form a prime number binary). Another aspect 
is that the repeat frequency will also set the density of frequencies in 
the noise. If you have a 7 bit noise generator, it will have a 127 bit 
long sequence, and having 63 overtones (before wrapping) at the density 
given by the sequence repetition rate. Since length is relatively cheap 
to achieve, sufficient length is reachable, but you also want it to run 
at highest possible rate for the full audio range coverage, so overdoing 
length in a processor will cut down on bit rate.
Once you have committed for another instruction, make sure it achieves 
highest possible length.

I once published a list of really long sequences here at Synth-DIY, very 
much like the one given in the link above. Mostly to show that lengths 
was achieveable as good taps was known. Achieving non-wrapping during 
the reminder of the universe isn't all that hard. Question is if it is 
worth it or not.

Cheers,
Magnus



More information about the Synth-diy mailing list