|
Generated with GNU Octave's random number generator rand(), which generates uniformly distributed random values in the interval [0,1). The wavwrite() function expects values in [-1.0, 1.0), so we multiply by 2 and shift down by 1. So to generate 10 seconds of noise sampled at 48 kHz:
white=rand(48000*10,1)*2-1;
I'm not sure about the inner workings of /dev/urandom, but I used the "reseed" command to feed it data from random.org, so this should be pretty random. To export this to a 16-bit, 48 kHz .wav file in our home directory, the command is:
wavwrite(white,48000,16,'white noise uniform.wav');
Then I converted the .wav file to a FLAC-encoded Ogg (.oga) file:
flac --ogg "white noise uniform.wav"
(The "compressed" FLAC file is actually larger than the .wav file.) :) Then I generated a lossily-compressed .ogg Vorbis file:
oggenc "white noise uniform.wav"
This allows the pristine, lossless file to be downloaded directly from File history, while the smaller lossy file is the one included in articles.
RMS value derived from:
sox "white noise uniform.wav" -e stat
and then in dB is 
Histogram derived from
Frequency analysis in Audacity.
|