From: martin@eichow.tuwien.ac.at (Martin Schoenhacker)
Subject: Re: SoundBlaster sampling frequency accuracy
Reply-To: martin@eichow.tuwien.ac.at
Organization: Tech. University Vienna, Dept. of Computergraphic
Date: Fri, 21 Aug 1992 11:38:36 GMT

Gilles recently brought the following to us:

>In article <1992Aug20.084909.5385@kth.se> pesjogre@nada.kth.se (Peter Sj{gren) writes:
>>Hi,
>>
>(... DELETED ...)
>>
>>I therefore wonder about the accuracy of the sampling frequency and other
>>data on this model (1.5) and if they are better on later versions.
>>
>        Ah, I suggest you read the programmers manual of the Sound Blaster...
>I don't have it at work with me, but you'll notice that the sampling
>frequency is stored in a specific format... Just count the bits, and you'll
>get the acuracy with which the sampling frequency is defined... That should
>help you...
>
>        As an example, say you're using 8 bits to define a frequency... And
>Your Frequence can go from 0 to 22000 Hz... Then you have a 86 Hz acuracy.
>At 11000 KHz, it's 43 Hz...  And so on... 440 Hz give 2 Hz accuracy.
>
>        Does this help?

No, sorry, it doesn't. There seems to be a misunderstanding here, so let me
have a go on getting this straight ...

The sampling frequency (e.g. 11000 Hz [not KHz as in your post]) defines how
often the sound card will sample its input channel, acquiring an 8-bit sample
(i.e. for the standard Soundblaster models). This sample corresponds to the
signal level on the input line, NOT to a frequency.

If someone uses this mechanism to record a 440 Hz tone, the sound card samples
a waveform which eventually should turn out to contain 440 full sinusoidal (or
the like) waves per second. Please note there was no need to talk about a
specific sampling frequency until now.

If the sample get replayed (or edited), the input sampling frequency becomes
important, since it will tell you how many of the sampled values should be
reproduced to the sound card speaker in unit time. And if that goes wrong,
i.e. more or less samples are being replayed per second than have been
recorded, there is a frequency shift between input and output signals.

For example, if a 440 Hz tone has been recorded at a sampling frequency of
11000 Hz, but is being replayed at an output sample frequency of just
10900 Hz, then the tone you hear will just contain 436 cycles per second,
i.e. 436 Hz.

So the problem is not one of using 8 bits, as in your example, to represent
the 440 Hz out of 22 kHz one might want to record, which would give a 86 Hz
inaccuracy and render the sound card unusable. Rather, it is one of getting
the input and output sampling frequencies to be the same.

Sorry I can't answer the original question about this phenomenon, but I hope
to have clarified what the question was about at all.

All the best,

                   Martin

 -----------------------------------------------------------------------
| Martin Schoenhacker     |  Lagerhausstrasse 19, A-3580 Horn, Austria  |
|-------------------------|---------------------------------------------|
| A U S T R I A  --       |  E-Mail:  schoenhacker@eichow.tuwien.ac.at  |
|   In the very Heart of  |  Phone:   +43 (1) 58801 / 4117              |
|     E  U  R  O  P  E    |  Fax:     +43 (1) 504 25 83                 |
 -----------------------------------------------------------------------