Game Development Reference
In-Depth Information
Digital Sampling Basics
Everybody should be familiar to at least some extent with the principles
behind digital sampling. Essentially it's very close to the process used
for i lm. In that situation a camera takes a certain amount of pictures, or
frames, in a second, of some kind of action. When all of these frames are
run back, the result fools the eye into believing that smooth motion is
taking place. In digital audio the process is similar but much faster than
in movies, and we need to take a lot more 'pictures' to fool the ear than
the eye.
Go to the Main
Classroom in the
App, and click on the
video screen to learn
more about linear vs
non-linear media and
adaptive audio.
Pulse-Code Modulation (PCM)
This method of representing analog signals in digital form is the basis
of how data for uncompressed audio is encoded. The method uses
sampling of the analog signal level at a specii c interval, and each sample
is converted to a digital value. PCM includes all uncompressed audio
i les of any kind like WAV and AIFF, or media encoded on CDs, DVDs, and
Blu-Ray. Since the data is represented in a single linear stream it's often
referred to as Linear PCM or LPCM.
There are two specii c characteristics that dei ne how PCM data is
encoded. The sample rate is ef ectively the number of audio pictures
taken per second. The higher the sampling rate, the higher the quality
of audio, but also the larger the i le size. Sampling is measured in hertz,
or cycles per second, and is usually found in the tens of thousands
range. For example, CD-quality audio (often referred to as '44.1') is at
44,100 samples per second. This is commonly represented as 44.1KHz or
kilohertz.
Now the human ear can technically hear from about 20Hz all the way up
to 20KHz. So why such a high rate? There's a lot of mathematical reasons
for this but the most important is that we need at least two samples to
describe any frequency. So this means that the highest frequency we can
hear from a sample rate of 44.1KHz is half of it—in this case 22.05KHz—
just about where our ears stop hearing anyway. This is called the Nyquist
frequency.
The next important thing to be concerned about here is bit resolution
or bit depth . This governs how wide a range of volume each sample has.
Here again, more bits = better i delity, but it also means larger i le size.
There is a lot of binary math here, but to simplify the situation each bit of
 
Search WWH ::




Custom Search