Audio Signal Generator can produce sine , square , triangular or sawtooth waves at frequencies from 10 Hz to 25 KHz. Frequency glide, gain ramping and signal burst are supported. Frequency can also be set by scientific pitch notation or via presets. Noise generation is supported for seven different noise colours. Multiple generators can be created and used concurrently.
Operating Notes:
The key characteristics of the signal generator are described below.
Frequency is adjustable from 10Hz to 25KHz, either by a slider or direct entry into a number box. The number box provides a spinner which steps by 1Hz. To precisely set the frequency, hold either the Shift, Ctrl or Alt key to step by 0.1Hz, Hold any two to step by 0.01Hz or all three to step by 0.001Hz. Scientific pitch notation can also be used which designates a note, followed by an octave, optionally followed by a sharp (#) or flat (♭) and is based on the equal tempered scale (twelfth root of 2 intervals). The note A above middle C is exactly 440Hz and is designated as A4. Middle C (on a piano keyboard) is 261.625Hz or C4. Eight octave spaced presets are provided, centred around 1kHz. Presets are provided on octaves starting at 250Hz.
Gain is adjustable from unity (0db) down to 0.0001 (-40dB) in logarithmic steps. As for frequency, the Shift, Ctrl and Alt keys can be used to precisely set the gain. Presets are provided for standard settings.
Signal Type - five waveform types with phase invert and seven noise types are available:
Sine
The sine wave is the "pure" sound that contains a single frequency only and is used extensively for audio measurement. This wave has the familliar symetrical wave shape.
Square
A square wave consists of a fundamental sine wave at the base frequency plus in phase odd harmonics of the fundamental. The amplitude of each harmonic is equal to 1/N where N is the harmonic (1, 3, 5, 7...).
Triangle
A triangle wave consists of a fundamental sine wave at the base frequency and odd harmonics of the fundamental that alternate between in-phase and 180° with each successive harmonic. In contrast to a square wave, the amplitude of each harmonic is equal to 1/N2 where N is the harmonic (1, 3, 5, 7...).
Sawtooth
A sawtooth wave rises linearly from 0 to 1 then immediately drops back to 0 before rising again. It consists of a fundamental sine wave at the base frequency and in-phase even and odd harmonics of the fundamental. The amplitude of each harmonic is equal to 1/N where N is the harmonic (1, 2, 3, 4...).
Reverse Sawtooth
A reverse sawtooth wave is also available by using the Invert checkbox. It rises immediately from 0 to 1 then falls linearly to 0 at the base frequency before rising immediately again. It consists of a fundamental sine wave at the base frequency and in-phase even and odd harmonics of the fundamental. The amplitude of each harmonic is equal to -1/N where N is the harmonic (1, 2, 3, 4...).
White The power in white noise is equal across all frequencies. White noise is widely used for testing audio equipment, masking unwanted sounds and as a baseline in sound experiments.
Pink The power in pink noise decreases by 3 dB per octave (power density ∝ 1/frequency). Pink noise mimics human hearing and is used for acoustic measurements, audio system calibration and simulating natural sounds (eg. waterfalls).
Brown The power in brown noise decreases by 6 dB per octave (power density ∝ 1/frequency2). Brown noise sounds deep and rumbling, emphasising lower frequencies. It is used for testing subwoofers, calming soundscapes and simulating natural phenomena like thunder.
Blue The power in blue noise increases by 3 dB per octave (power density ∝ frequency). Blue noise sounds sharper and harsher than white noise, emphasising higher frequencies. It is used for dithering in digital audio, special effects, and high-frequency testing.
Violet The power in violet noise increases by 6 dB per octave (power density ∝ frequency2). Violet noise has intense high frequencies, similar to a high-pitched hiss. It is used for tinnitus masking and high-frequency testing.
Green Green noise emphasizes the midrange frequencies (around 500 Hz to 5000 Hz), associated with natural sounds like wind or rustling leaves It aligns with the frequencies most sensitive to human hearing and is created by band-pass filtering white noise to retain only this range.
Grey Grey noise is perceptually equal across all frequencies when adjusted for the human ear's sensitivity, based on equal-loudness contours such as the Fletcher-Munson curve. It compensates for the fact that humans hear midrange frequencies more prominently than very low or very high frequencies and is used for psychoacoustic research and audio perception studies.
Glide involves moving smoothly from a starting freqency to an end frequency over a set time period. Repeat can be added which can be set to reverse and glide back or change immediately to the start frequency and repeat the glide until the generator is stopped. A delay can be added at the end of the glide to hold the final frequency for the delay period. Alternatively, the glide can be replaced by a step which changes from the start frequency to the end frequency half way through the glide period.
Ramp involves ramping from a starting gain to an end gain over a set time period. Repeat can be added which can be set to reverse and ramp back or change immediately to the start gain and repeat the ramp until the generator is stopped. As for glide, a delay can be added at the end of the ramp to hold the final gain for the delay period. Alternatively, the ramp can be replaced by a step which changes from the start gain to the end gain half way through the ramp period.
Burst involves generating a signal for a set time period then stopping. Repeat can be added which will wait for a set time period then repeat the burst until the generator is stopped.
Glide, Ramp and Burst can be used simultaneously to produce complex test signals for a wide variety of applications.
Design Notes:
These notes describe design considerations related to the implementation of the signal generator.
Interface Design uses a master page (this page) from which multiple independent signal generators can be created. This allows combinations of signals to be generated concurrently. Try generating signals one or two hertz apart. The master page includes controls to start or stop all generators with a single click.
Audio Context is a Javascript object to generate audio and includes classes to create an oscillator, set the signal type, create a gain control and create a dynamic compressor. The compressor is not used in this app.
Audible Clicks are a well known issue when starting, changing gain and stopping an oscillator. The most reliable way to eliminate clicks is to use the exponential ramp method immediately preceded by specifically setting the gain to the current value (even though this shouldn't be necessary).
Pitch Standard used is the current international pitch standard of A440, which was adopted in 1955. However, A4 may be tuned to other frequencies under different tuning standards.
The Pink, Brown, Blue and Violet noise algorithms implement the noise filter based on a widely used approach by Paul Kellet. The algorithm applies a set of coefficients to filter white noise into the required noise profile.