frequency spectrum of white noise from a 24 bit shift-register based RNG? - Page 1
Forum section: electronics / beginners

author: legrady
author_rank: Contributor
timestamp: February 18, 2025, 10:43:15 pm
content: I am looking to build a 24-bit random number generator using 3 4021 shift registers and 4070 XOR. The final bit is fed into a filter to be interpreted as white noise. I believe the original design I looked at was using a 22 MHz clock. So input gets to the end of the shift register series after about 1 uSec.My ears clip hard below 20KHz, so does anything above 15KHz even matter? How does clock frequency correlate to audio 'harmonic' frequency? To what extent are high frequencies important in white noise?

author: CaptDon
author_rank: Super Contributor
timestamp: February 19, 2025, 12:14:42 am
content: I never thought RNG noise generators were faithful to white noise but seemed to have many sharp narrow peaks. I still prefer noise diodes with shaping filters White, Pink, Etc. Transistors can be good noise generators also. I hope many folks chime in here with their observations.

author: shabaz
author_rank: Frequent Contributor
timestamp: February 19, 2025, 01:36:23 am
content: There's an example of the spectrum output for that style* of noise generator in reply #5 here:https://www.eevblog.com/forum/rf-microwave/white-noise-generator-is-there-a-chip-combining-lfsrs-and-analog-output/msg5714219/#msg5714219The circuit was taken from Art of Electronics, although I used a CPLD instead of the separate logic ICs, and a few other minor mods, but the circuit in AoE functions, it has no mistakes.If you're curious about the audible difference of noise to 15 kHz or to 20 kHz, one way to examine that would be to generate noise on your PC (e.g. using Matlab or Octave), and then low-pass-filter it and listen to it (Matlab and Octave will allow saving to a WAV file). Or, maybe free Audacity software does all this with button-clicks and no coding, but I'm not familiar with that software.*EDIT: The AoE circuit is different to what you precisely describe, in that multiple taps from the shift register are used; the reason for that is it becomes a clever way to perform filtering; this is described in AoE.

author: radiolistener
author_rank: Super Contributor
timestamp: February 19, 2025, 11:22:49 am
content: Quote from: legrady on February 18, 2025, 10:43:15 pmFor white noise all frequencies are equally important, because they all should have the same average level. Clock frequency affects distortions which can produce harmonics, spurs and other spectral components like aliasing.

author: srb1954
author_rank: Super Contributor
timestamp: February 19, 2025, 12:22:42 pm
content: Quote from: legrady on February 18, 2025, 10:43:15 pmWith a SR-based random noise generator the output is not true white noise but only an approximation to it. Specifically, it is a repetitive pattern determined by the length of the SR and the output spectrum consists of closely spaced spectral lines at multiples of that pattern repetition rate. These spectral lines gradually tail off in amplitude but if you filter the output with a LPF filter with a cutoff much lower than the clock frequency it makes an acceptable substitute for real white noise.With your example of a 24-bit SR the pattern will repeat every 224-1 clock cycles. If you clock the SR at 22MHz as you suggest the pattern will repeat every 762ms - the repetitive nature of this pattern will likely be be plainly audible and hence not be a suitable substitute for white noise. I suggest that you lower the clock frequency so that the pattern is at least 10sec long to minimise the audible effect of the pattern repetition. This would require a clock of 1.68MHz or less.

author: themadhippy
author_rank: Super Contributor
timestamp: February 19, 2025, 01:03:09 pm
content: wots wrong with the ole untuned radio

author: CaptDon
author_rank: Super Contributor
timestamp: February 19, 2025, 01:33:31 pm
content: RadioListener, wouldn't it be more accurate to say "Your ears clip hard ABOVE 20KHz", or actually they don't clip, they become insensitive. Strangely enough although not sensed as an audible response very loud (110+ dB) audio tones in the 22KHz to 35KHz will still produce headaches and a feeling of anxiety. When I was in my early twenties and working in sound engineering and radio broadcast I could hear clearly to 18KHz. During my radio broadcast career we had a legally blind D.J. who helped me train my ears. It was astonishing what he could detect and describe to the engineering department when our audio chain was beginning to suffer. My engineering co-workers thought the guy was a 'complainer' but I found out when he said something was not right if you looked hard enough with the proper equipment and an open mind you surely could and would find a problem!! B.T.W., now that I am an old fossil my hearing goes off a cliff at 12KHz!! Playing in a rock band and working on locomotives sure didn't help things!!