[sdiy] Non maximal-length LFSR

Nils Pipenbrinck n.pipenbrinck at hilbert-space.de
Thu Mar 3 16:36:56 CET 2016


On 03/03/2016 03:51 PM, Richie Burnett wrote:

> Noise is random anyway, right?  so throwing
> away one word out of every 49 would still sound like random noise?  (It
> would surely sound better than generating 47 words and repeating the
> last one twice!)  But the length of the sequence would be 48/49th of the
> maximum length, but 2^49 is huge anyway, so I don't care?  Does that
> sound reasonable?

Hi Richie,

throwing away a byte every now and then sounds reasonable. I would be
surprised if this causes any audible artefacts.

Regarding noise generation and LFSRs in general:

As far as I know the dsPIC has a CRC engine. CRC is in a nutshell just a
LFSR so it can likely be abused as a cheap random generator. Have you
tried that?

Also you can always mix two not-so-good random streams together to get a
longer and often better random data stream. Say you have a stream with a
sequence length N and another one with a sequence length M the xor of
the two streams yields a random stream of length GCD(m,n).

This is often done in hardware random generators for cryptographic
purposes: One stream comes from a LFSR with an even one/zero bit bias
but a predictable pattern. The other one comes from some analog source
with unknown bias but no repetitions. The result stream now has the best
of both properties: It has no sequence and is even biased.

Best,
Nils



More information about the Synth-diy mailing list