[sdiy] Non maximal-length LFSR
Ove Ridé
nitro2k01 at gmail.com
Thu Mar 3 10:14:14 CET 2016
Which platform is this? Doing 4 taps shouldn't be *that* much worse,
at least if you're doing things right™.
You could just tap bits 47 and 42, which is the optimal length for a
47 bit register, even though the register is 48 bits in length. This
means that the top bit is unused, ie you're using your 6 bytes as a 47
bit register. LFSRs are named after the highest tap bit, so if you use
bit 47 and 42 that's by definition a 47 bit register. But nothing
stops you from using just bit 47 and 42 even if your data structure is
48 bits.
As for checking the validity of the tap bits, you could always
simulate it on your platform, or on code running on a PC, where you
run the LFSR and count the cycles before it reaches the original state
again. If it matches, turn on an LED or whatever.
On 3 March 2016 at 09:16, Richie Burnett <rburnett at richieburnett.co.uk> wrote:
> Hi guys,
>
> I'm wondering if one of the maths gurus here can help me out with
> something...
>
> I want to make a white noise generator using a Linear Feedback Shift
> Register. However, rather than using one of these (see link below)
> polynomials to choose the feedback tap locations to achieve the maximum
> possible length sequence, I would like to choose a sub-optimal polynomial
> for reasons of computational efficiency on the chosen implementation
> platform. My question is then, how long will the resulting pseudo-random
> bit sequence be?
>
> For example there are maximum-length polynomials shown for shift-register
> length 47 and length 49 that contain just two taps. That's great because
> they're cheap to implement, but the maximum-length polynomial for
> shift-register length 48 contains four taps and is more expensive to
> implement. In-short I want to use a shift-register of length 48 bits, but
> with just 2 taps, and accept the fact that I won't get a maximum-length
> sequence of (2^48)-1 bits out of it, but it will hopefully still be quite
> long and adequate for white noise synthesis purposes.
>
> In response to "why don't you just try it and find out" I've coded up my
> noise generator, and I can't hear any repetition, but obviously my ear
> probably isn't going to detect the repeats if they're more than a few
> seconds apart. I've also looked at the average power spectrum of 3 mins of
> noise, versus the average power spectrum of 6 mins, and the second spectrum
> is much flatter suggesting to me that the sequence isn't simply repeating
> over in the additional 3 mins. My problem is getting some handle on the
> sequence length but I suspect it is going to get complicated, and possibly
> even depend on the initial conditions of the shift-register!? I can't even
> get an answer in a reasonable time using simulation or autocorrelation
> because even though the polynomial doesn't result in a sequence that's
> maximum-length, it's probably still very long?
>
> Any help or pointers would be much appreciated.
>
> Many thanks,
>
> -Richie,
>
> * http://www.xilinx.com/support/documentation/application_notes/xapp052.pdf
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at dropmix.xs4all.nl
> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
--
/Ove
Blog: <http://blog.gg8.se/>
"Here is Evergreen City. Evergreen is the color of green forever."
More information about the Synth-diy
mailing list