Steady Sine Sweep

Steady Sine Sweep

Post by Christopher John Rol » Mon, 21 Mar 1994 07:38:28



        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

--

 
 
 

Steady Sine Sweep

Post by Jim VanKoughn » Tue, 22 Mar 1994 02:14:00



>    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

>--

The problem you have could be the result of several factors. First, it
is not possible, in practice, to include frequencies near, or at fs/2
since practical anti-aliasing filters will need a finite transition band
between passband and stopband. A second concern is that aperture
correction may be needed to obtain flat frequency response, depending
on how the D/A converter is used.

The phase accumulation method you propose appears to valid from a
digital point of view. The analog side could be simplified by increasing
fs (ie over-sampling), then your anti-alias filter contraints would
be loosened. Many audio D/A convertors using sigma-delta techniques do
this for you.

Hope this helps,



 
 
 

1. logarithmic sine sweep

I am able to generate a linear sine sweep using the following code:

f_lo = StartFrequency / SampleRate;
f_hi = StopFrequency / SampleRate;

samples = SampleRate * sweeptime;

a = 2 * PI * (f_hi - f_lo) / samples;
b = 2 * PI * f_lo;

for (index = 0; index < samples; index ++)
  m_pSweepData[index] = sin(a * index * index / 2 + b * index);

I would like to modify this code to generate a logarithmic sweep.  Any
ideas or suggestions?

Thanks!

2. Mark Sent Folder as Read

3. Q:FFT and sweeping sines

4. genmod

5. IIR steady state error

6. QUESTION: rmail-output-file-alist

7. Comparing results of FFT vs. Swept Spectrum Analyzer

8. STOP 0x50 PAGE Fault fatal error- HELP

9. mp3 is sweeping of consumer market..??

10. Fourier analysis of swept frequencies...

11. Simple sweep w/ white spectrum algorithm?

12. Get the impulse response using a sweep instead of an impulse

13. Impulse from sweep response?