Introduction
When CDs were first introduced in the early
1980s, their single purpose in life was to hold
music in a digital format. In order to understand
how a CD works, you need to first understand
how digital recording and playback works and
the difference between analog and digital technologies.
We will examine analog and digital recording
so that you have a complete understanding of
the difference between the two techniques.
In the Beginning: Etching Tin
Thomas Edison is credited with creating the
first device for recording and playing back
sounds in 1877. His approach used a very simple
mechanism to store an analog wave mechanically.
In Edison's original phonograph, a diaphragm
directly controlled a needle, and the needle
scratched an analog signal onto a tinfoil
cylinder:

You spoke into Edison's device while rotating
the cylinder, and the needle "recorded"
what you said onto the tin. That is, as the
diaphragm vibrated, so did the needle, and
those vibrations impressed themselves onto
the tin. To play the sound back, the needle
moved over the groove scratched during recording.
During playback, the vibrations pressed into
the tin caused the needle to vibrate, causing
the diaphragm to vibrate and play the sound.
This system was improved by Emil Berliner
in 1887 to produce the gramophone, which is
also a purely mechanical device using a needle
and diaphragm. The gramophone's major improvement
was the use of flat records with a spiral
groove, making mass production of the records
easy. The modern phonograph works the same
way, but the signals read by the needle are
amplified electronically rather than directly
vibrating a mechanical diaphragm.
Analog Wave
What is it that the needle in Edison's phonograph
is scratching onto the tin cylinder? It is
an analog wave representing the vibrations
created by your voice. For example, here is
a graph showing the analog wave created by
saying the word "hello":

Click here to
hear the word.
This waveform was recorded electronically
rather than on tinfoil, but the principle
is the same. What this graph is showing is,
essentially, the position of the microphone's
diaphragm (Y axis) over time (X axis). The
vibrations are very quick -- the diaphragm
is vibrating on the order of 1,000 oscillations
per second. This is the sort of wave scratched
onto the tinfoil in Edison's device. Notice
that the waveform for the word "hello"
is fairly complex. A pure tone is simply a
sine wave vibrating at a certain frequency,
like this 500-hertz wave (500 hertz = 500
oscillations per second):

Click here to
hear the tone.
You can see that the storage and playback
of an analog wave can be very simple -- scratching
onto tin is certainly a direct and straightforward
approach. The problem with the simple approach
is that the fidelity is not very good. For
example, when you use Edison's phonograph,
there is a lot of scratchy noise stored with
the intended signal, and the signal is distorted
in several different ways. Also, if you play
a phonograph repeatedly, eventually it will
wear out -- when the needle passes over the
groove it changes it slightly (and eventually
erases it).