Analog and Digital Signals
Nearly all physical processes are analog. Whenever you observe a natural phenomenon,
such as electricity or sound, you’re actually receiving an analog signal. One of the
most important properties of these analog signals is that they are continuous. For
every given point in time, you can measure the strength of the signal, and in principle
you could register even the tiniest variation of the signal.
But although we live in an analog world, we are also living in the digital age. When
the first computers were built a few decades ago, people quickly realized that it’s
much easier to work with real-world information when it’s represented as numbers
and not as an analog signal, such as voltage or volume. For example, it’s much easier
to manipulate sounds using a computer when the sound waves are stored as a
sequence of numbers. Every number in this sequence could represent the signal’s
loudness at a certain point in time.
So instead of storing the complete analog signal (as is done on records), we measure
the signal only at certain points in time (see the following figure). We call this process
sampling, and the values we store are called samples. The frequency we use to
determine new samples is called the sampling rate. For an audio CD, the sampling
rate is 44.1 kHz: we gather 44,100 samples per second.
We also have to limit the samples to a certain range. On an audio CD, every sample
uses 16 bits. In the following figure, the range is denoted by two dashed lines, and
we had to cut off a peak at the beginning of the signal.
Although you can connect both analog and digital devices to the Arduino, you usually
don’t have to think much about it. The Arduino automatically performs the conversion
from analog to digital for you.
report erratum • discuss
Exploring the Arduino Board • 9
www.it-ebooks.info