Audio Test File Generator Specifications
The goal was to produce a generator of audio frequency sine wave signals of the highest possible quality that may be used as a frequency standard for testing all components in the path of the signal. A very thorough specification follows, with the aim to increase the usefulness of the signal generator for sound engineers.
The sine wave generator
In the quest to create "the perfect wave", I went a bit overboard. The floating point calculations that produce the sine wave employ 80 bits of internal precision. Each signal generated is a perfectly symmetrical series of whole waves so as to end up with a negligible DC component. Whatever DC remains is removed, so that for any given frequency of 10 seconds duration or less, the DC level is guaranteed to be 0. The actual DC level before correction is pre-calculated on a sample by sample basis, so a slight delay may be noticed when generating signals approaching 10 seconds in duration. Since DC correction is not applied to signals of a duration greater than 10 seconds, no delay is entailed in this case.
Each sine wave signal generated begins and ends with a smooth linear taper of exact multiples of the period to eliminate speaker pops and clicks (see image above). The taper length depends on the duration of the signal requested, with the maximum duration set to approximately 0.01 seconds. The minimum taper length is equal to the period of the requested frequency.
Signal duration is equal to exact multiples of the period at the requested frequency, such that they add up to at least the duration requested in seconds.
Minimum signal duration is limited to the nearest exact multiple of the period equal to or greater than 0.01 seconds, or the time it takes to play two whole waves at the requested frequency - whichever is greater.
Minimum frequency that can be generated is 10 Hz, and the maximum is 22050 Hz.
The signals employ 16 bit samples, which allow for approximately 93 dB of dynamic range.
To avoid saturation while allowing room for DC correction - should it be required,
the maximum signal value is limited in absolute terms to max_amplitude - 2, as follows...
Absolute value of maximum amplitude = 0x00007FFD hex
Maximum dBs = 90.308203445843149315418557642522
The minimum attenuation is 0 dB.
Maximum attenuation permitted is 60 dB.
If attenuation is applied, the signal level is calculated based on
0 dBs defined as 20 x log10(0x00007FFF) for 16 bit audio
Attenuation is also calculated with the highest precision possible.
File are generated in the form of Window's RIFF PCM Waveformat files. Each begins with a lead in of 256 samples of silence. Sine waves end with a lead out of between 0 and 255 samples of silence.
The sweep wave generator
The sweep generator employs a swept sine wave function and does not include DC correction. It can sweep up or down. The minimum and maximum frequencies and attenuation values allowed are the same as for the sine wave generator. The minimum sweep duration is 0.1 seconds and the maximum is 60 seconds. Duration is rounded up to the nearest multiple of 128 samples. A linear taper of 128 samples is applied to the end of the signal. During taper down, the frequency is held at the ending frequency requested.
The pink noise generator
The pink noise generator employs an algorithm by Andrew Simper of Vellocet, a c++ implementation derived from the code provided by the following people mainly from the music-dsp mailing list: Allan Herriman, James McCartney,Phil Burk and Paul Kellet and the web page by Robin Whittle: http://www.firstpr.com.au/dsp/pink-noise/.
From Wikipedia: "Pink noise, also known as 1/f noise, is a signal or process with a frequency spectrum such that the power spectral density is proportional to the reciprocal of the frequency. There is equal energy in all octaves (or similar log bundles). In terms of power at a constant bandwidth, 1/f noise falls off at 3 dB per octave. At high enough frequencies 1/f noise is never dominant. (White noise is equal energy per hertz.) 1/f noise occurs in many physical, biological and economic systems. Below are images showing spectral views of the signals produced by the Audio Test Signal Generator