psuedo Noise Generator

The Old Crow oldcrow at oldcrows.net
Thu Sep 7 02:21:04 CEST 2000


  Have a look at:

  http://www.oldcrows.net/~oldcrow/noise508_63.asm

  It expands the shift register to 63 bits, with taps at 62 & 63 as
per the 1 + X + X^63 polynomial.  The only tradeoff is that the loop time
for a bit is 4us longer, lowering the max. frequency to 17.8KHz or so.
With a bit of tweaking, I can shrink the loop time again.  Here is the fun
part: (from the code comments)

;
;   The main loop 'taps' is 28 CPU cycles.  At the 4MHz internal clock
; rate, the noise output is operating at a max. rate of about 17.8KHz.
; It is 1 microsecond per CPU cycle, so 28us per bit output.  It takes
; two bits (one high, one low or vice-versa) to define the highest
; frequency, or a period of 56us.  The highest frequency is thus 17,857Hz.
; Since the LFSR will cycle through 2^63-1 states, it will take
; 9,223,372,036,854,775,807 iterations of the taps loop to return to the
; starting seed value.  At a rate of about 35,714 loops per second, it 
; will take a mere 8,183,588 YEARS to repeat.
;

  I think I got that right... ;)

Crow

/**/




More information about the Synth-diy mailing list