From: glen herrmannsfeldt on
gretzteam <gretzteam(a)n_o_s_p_a_m.yahoo.com> wrote:
(previous snip regarding LFSR random sequences)

>>As you don't say what you want to use the results for, it is
>>hard to say.
(snip)

> Ok I see what you mean...my application is far from cryptography!
> I'm trying to dither the phase of a DDS. The NCO is 24 bits,
> and gets quantized to 10 bits going in the ROM. From my simulations,
> I need about 4 bits of dither to make the spurs go away.

In that case, you might be able to just use four bits off
the 16 bit LFSR. There will be correlations in the bits, but
they should be long range enough not to notice. Are you doing
this in hardware, such as an FPGA?

I once wrote a program to convert 24 bit WAV files to 16 bit
(for personal use). In my first try, I just truncate the extra
bits, after a possible shift left. Then I decided I should
dither, and already had a routine to calculate CRC32, so I
used that one. CRC32 is a LFSR on the bit stream, which, in
software, is easy to calculate a byte at a time. I then used
the low bits of the CRC32 at each sample as the dither value.

To test it, I took one WAV file and wrote a CD with successive
tracks right shifted by one bit more and truncated, and another
right shifted and dithered. The dithered result was noticably
quieter than the truncated version. (As the amplitude decreased
I would turn up the volume and listen ever more carefully.)

As the low bits or a 24 bit WAV file are likely already pretty
random, (that is, noise from the amplifiers in addition to any
noise in the recorded signal), I was not worried about any
residual correlations.

-- glen