I'm looking for references to detailed discussions of the
digital representation/generation of audio test tones, specifically a sine
sweep from 20 Hz. to the Nyquist freq.
Let's say we want to generate a sine tone that rises by 1
octave/sec:
The simple answer is to take the sine of
the phase at 0, and add a phase increment each sample period. The
phase increment is calculated according to the frequency which is
rising at the rate 2^(2/Fs), where Fs is the sampling rate.
This DOES generate a rising sine tone.
Unfortunately, the amplitude varies according to the
instantaneous phase. In the worst case, at the Nyquist freq, with only
two samples per period the phase might be 0 and 180 degrees resulting
in a perfect sine tone with ZERO amplitude! These amplitude anomalies
are extremely audible in an audio application.
How then best to hide the problem from an audio/perceptual
point of view? Some sub-audio rate frequency modulation
would be acceptable. Any suggestions? Any code (Forth, C, 680x0, or 56k)?
Chris
--