[sdiy] AVR/ARDUINO psuedo random noise?

Magnus Danielson magnus at rubidium.dyndns.org
Wed Feb 16 18:58:55 CET 2011


On 02/16/2011 06:35 PM, dan snazelle wrote:
> On Feb 16, 2011, at 11:46 AM, Magnus Danielson wrote:
>> The trick here is to xor the output but backwards, which is an alternative approach that can be used. I could have fluked the feedback vector, so that may require trimming, but at least I show the code principle.
>
> XOR The output but backwards? not quite sure what you mean. I will go try this out!

Sorry for being fuzzy.

One very popular way of implementing a PRNG/LFSR is SSRG/Fibonacci LSRG:

http://en.wikipedia.or/wiki/Linear_feedback_shift_register#Fibonacci_LFSRs

Where you tap a few delay variants at assigned locations ad (see 
figure), XOR them together and use that as the input to the delay-chain.

The downside with this method for a CPU implementation is that you will 
need to do a lot of bit-manipulation.

Another approach is to implement the MSRG/Galois LSRG form:
http://en.wikipedia.org/wiki/Linear_feedback_shift_register#Galois_LFSRs

Looking at it, I should have reversed the feedback-polynomial 
bit-wise... so it should have been 0xC0000400 if I wrap it right at the 
top of my head.

Cheers,
Magnus



More information about the Synth-diy mailing list