Testing White Noise Generator Devices

White noise from speaker or headphones can promote relaxation. White noise is flat for the audio spectrum, the mind soon knows the random sound contains nothing of interest to process so it can relax. White noise occurs naturally in oceans and waterfalls however that source is interrupted by the spurious sounds of breezes and birds. There is additional loss due to the quality of recording gear.

There are several methods for electronic generation of white noise. I tested two: (1) analogue white noise by exploiting the breakdown characteristic of a transistor emitter-base p-n junction. (2) digital shift registers. (more deterministic and reliable)

1. 2N3904 Transistor

The ONSEMI document has a single entry "Emitter −Base Breakdown Voltage (IE = 10 microAamp-dc, IC = 0) .. 6volts"
and nothing is explained. This is typical for transistor data. Since transistors are intended for amplification or forward switching, the breakdown characteristic is a bug, not a feature. However, this bug can be exploited to produce white noise by avalanche provided that the circuit topology limits the 10 microamp flow.

There is an abundance of white noise circuit variations on the WWW. I copied one that has two transistors gained by filtered negative feedback which I could observe on my economy oscilloscope. However, here is a careful design with quality documentation...
Random Sequence Generator based on Avalanche Noise (Giorgio Vazzana) .. It is much better than mine which comes without documentation...

diy-1.png


Note: TBD items are optional. Q2 must have a 10X scope probe -- a 1X probe can cause clipping.

clip1.png

clip3.png


2. Digital Shift Registers

The Linear Feedback Shift Register (LFSR) algorithm can produce a pseudo-random stream of bits. It is interesting to design hardware shift registers for random noise LFSR, they are well defined. However, it is more practical to use the registers of an MCU such as Microchip PIC. I got a couple with the PIC12F65 LFSR-1B firmware from https://electricdruid.net/

druid-intro.png


pic_sch1.png

Download the document which shows the PIC with Pink Noise filter for audio testing.

bshot1.png

bshot2.png


[1] https://www.edn.com/white-noise-source-flat-from-1hz-to-100khz/ (using a Zener 1N759)
[2] https://sound-au.com/project11.htm (pink noise for audio testing)
[3] https://www.analog.com/en/design-notes/whitenoise-generator-has-no-1f-component.html
 
EdGr: The PIC white noise generator has several shortcomings.

Thanks for the LFSR table but what are the shortcomings of the PIC. What LFSR device do you recommend for DIY audio purposes.

White noise is directional and may not be good for the typical hifi setup. So I am thinking of a small box with speaker, earphone jack, chipamp and wall-wart to rest on the desk facing me. The Electric Druid PIC device is the only suitable device for that concept. Option, add to that a pink noise filter for testing audio gear.

The PIC device is an upgrade for Synth panels using legacy white noise circuits.
 
The PIC output is a pulse. It needs a low-pass filter to generate an analog waveform. Also, a 1-bit converter needs to clock faster than 100KHz.

Alternating between two relatively short LFSRs will fail a test of randomness (self-correlation).

You want a single LFSR with longer length. A 1-bit D/A is fine as long as it clocks fast enough and has an output filter.
Ed
 
Why not just download and install REW?

It can do both the oscilloscope function (with a sound card) and generate white / pink noise. In addition, it can filter the noise; I've only used low pass. Pretty sure it can go from brick wall to the different octave slopes. It can write the filtered noise it generates to a file, so you can play it back on anything! It can make the noise as long as you want in time.

One of my test setups - that I've purported here - uses a little ebay/alibaba amplifier that plays back files stored on a SD card. Generate the sound in REW, save it to a file, copy the file to a SD card and there you have it. White / Pink noise generator with arbitrary bandwidth - just put in the numbers on the GUI - let 'er rip - and do the file ops.

Unless you have your heart set on constructing something, you can likely do it with bits you probably already have lying about. Like an old MP3 player with only 1G memory...
 
The PIC output is a pulse. It needs a low-pass filter to generate an analog waveform. Also, a 1-bit converter needs to clock faster than 100KHz.

Alternating between two relatively short LFSRs will fail a test of randomness (self-correlation).

You want a single LFSR with longer length. A 1-bit D/A is fine as long as it clocks fast enough and has an output filter.
Ed
These seem to be sophisticated ideas but I have to ask .. Is there any evidence to support them. By evidence I mean a thru-hole device, like the PIC, that can be soldered to an application PCB.

So far I have found that transistor white noise is fundamentally flawed but the Druid PIC is satisfactory for white and pink noise. However, I would like to see other designs, like the PIC, that do not require starting from scratch. Most findings on Google search are of interest only to academics or those who possess obsolete ICs.
 
Pink noise is filtered white noise. So is 'brown' noise. So white noise is your raw lumber before painting.

There was a "digital random" chip 30 years back. I used it a lot. But the repeat was very audible, every few seconds a thump. The consistent dynamics and non-tone sound made it good for level line-up and also spectrum analysis.

The back-biased BJT is cute when it works but gets iffy in 9V systems and can be quite inconsistent in level and "tone" (probably randomness versus popcorn). And needs big gain.

If you need to use an opamp or two, why not let the opamp hiss? TL072 is very cheap. TI-badged devices were reliably hissy (not too high but never low-low). There's a 1/f part if you want subsonics.
Hiss-TL072.gif

"Vref" is a low-Z half-supply reference. The 3k3 and 1nFd roughly compensate the 1/f rumble. Any standard pink filter can be added.

For this use, the 'new improved' TL072-H is NOT better.
TL072-H-Hissssss.gif
 
Last edited:
If you want to verify whether your source is indeed producing white noise you need to look at the frequency spectrum (which should be flat) and the amplitude distribution vs time (which should be normally distributed).

Noise from current flowing through a diode should be pretty close to white. It'll probably have some 1/f component (so be a little pink). But that should be close enough to white for most purposes.

Tom
 
  • Like
Reactions: ezavalla
Testing With Dieharder

Dieharder is Diehard with free (as in GPL) licence. It is available as an optional package on Linux and other platforms. It is mainly for RNGs -- random number generators, by processing their bit files. See http://holdenc.altervista.org/avalanche/ for an example of the considerable effort required for RNG tests.

When preparing to use Dieharder, it is necessary for an MCU to sample the device bit stream and file these samples for hours. An ordinary MCU with a USB serial port can do that. Dieharder may make multiple passes of the bitfile while running subtests. This process will statistically indicate that the RNG is maybe sufficiently random.

Apparently all this testing is not necessary for audio gear. If the devices already tested here, sound good, then requirements are satisfied. They are not intended for RNG use.
 
The PIC output is a pulse. It needs a low-pass filter to generate an analog waveform. Also, a 1-bit converter needs to clock faster than 100KHz.

Alternating between two relatively short LFSRs will fail a test of randomness (self-correlation).

You want a single LFSR with longer length. A 1-bit D/A is fine as long as it clocks fast enough and has an output filter.
Ed
Hi Ed, I don't understand a 1bit converter at 100khz. I assumed that a variable pulse rate upto 40khz would be sufficient.
 
White noise is bright and harsh, not relaxing. You must mean pink or brown noise. White noise is the sound of a massive air or steam leak from a high pressure system, for instance - if its very quiet its OK, but not at volume. Think sibilance or hiss.

Most "white noise" videos on Youtube are nothing like white noise, note. White noise has twice as much power in each octave as the one below it, so to our ears seems all high frequency. Pink or 1/f noise has equal power in each octave which sounds much less hissy and much more waterfall-like. In fact once you are any distance the natural attenuation of higher frequencies in the atmosphere means brown noise is perhaps a better approximation. If you have Audacity installed it can generate white pink or brown noise - you'll see what I mean.

Brown noise is easy to generate from white noise with a 1 pole low-pass filter (integrator). Pink noise is less easy as no simple filter can turn white to pink accurately.

One way to generate white noise digitally using a DAC, generate a gaussian random number for each sample (though you occassionally have to clip) - each sample is independent for white noise (one of its defining properties). In the analog world avalanche breakdown diodes (zeners of 10V or more) are very prolific generators of noise, which is pretty white across the audio spectrum
 
  • Like
Reactions: ezavalla
I wrote a small C program to find maximal length LFSR polynomials back in 1998, and it was posted by: http://www.eccpage.com/polym.c
However, it is limited to the size of the compiler long integer, ie 31 bits. Short polynomials are quick, but it takes serious computing time to find longer polynomials. But today's computers probably rip through them too.
Before that, back in Canada, I spend a lot of time with pink noise equalizing sound systems using graphic equalizers. In those days, we used a "real time analyzer" which was ~30 filter bands and a 30 way analog mux that created a graph on a scope. There were no PCs capable of doing spectrum analysis in real time. We had an HP audio sweep and plot generator, ie on paper that we used on speakers and crossovers.
Pink noise filters (-3dB/oct) were (are?) always as accurate as you can afford, ie a series of RC stages as close as a reasonable number of stages allows.