Documente Academic
Documente Profesional
Documente Cultură
The words analog and digital are used a lot, but what do they mean? Here we'll look at those
two worlds which you use every day.
Signals
A signal is a varying wave, typically carrying information we care about. Sound is a great example
of a signal, and we'll use that as a running example today.
https://web.stanford.edu/class/cs101/analog-digital-1.html 1/11
12/26/2017 Analog and Digital - Analog
Analog Process
Sound is vibrations in the air over time -- essentially small changes in air pressure over time.
When a violin plays, the wood top and back of the instrument flex in and out, producing little
ripples of air pressure which flow out from the violin, like ripples in a pond. When the ripples hit an
ear drum, it vibrates back and forth with the pressure changes, translating them into something
your brain can sense. Your brain can easily distinguish the sound of a violin or voice or pipe organ
playing the same note, but it is hard to put the differences into words. This is a very analog
sequence -- the signal goes from one medium to the next, keeping its basic shape.
Oscilloscope
An oscilloscope really embodies the idea of analog. An oscilloscope connects to wires, looks at the
electrical signal varying over time, and draws that signal on its screen in real time. Voltage is on
the vertical axis, and time is the horizontal axis. So the oscilloscope takes in something pretty
abstract -- signal varying over time -- and makes it visual.
https://web.stanford.edu/class/cs101/analog-digital-1.html 2/11
12/26/2017 Analog and Digital - Analog
Demo
Screen is 1/100 of a sec across
Signal is drawn over itself
See: frequency, amplitude, timbre
Below are oscilloscope screenshots for various notes. The width of the oscilloscope screen here is
1/100th of a second. The little random jags are just random noise from the cheesy, duct-tape way
I wired this all together. The horizontal green line in the screenshots is an unimportant artifact of
the oscilloscope. It represents a height value for which the oscilloscope tries to freeze the wave,
hitting the y axis right at that value.
https://web.stanford.edu/class/cs101/analog-digital-1.html 3/11
12/26/2017 Analog and Digital - Analog
https://web.stanford.edu/class/cs101/analog-digital-1.html 4/11
12/26/2017 Analog and Digital - Analog
Same C note as above, but now a flute timbre (shape) instead of sine wave:
Very often the sound -- or "signal" -- has a repetitive up/down pattern, with the peaks of the
curves hitting at a regular interval, such as every 400th of a second. We hear a regular, repeating
cycle like this as a musical "note". If the repeating pattern is a mathematically smooth sine wave,
we hear it as a very pure, bell-like sound.
Frequency -- suppose a signal repeats 100 times per second, also known as 100 "cycles" per
second, that's a frequency of 100. If the signal repeats more rapidly, we hear that as a "higher"
note. An "octave" in music corresponds exactly to a doubling in frequency (i.e. twice as many
up/down cycles in the same amount of time). The musical tuning standard is that A above middle
C on a piano keyboard is 440 cycles per second. Going up to the next higher A note (about one
hand's width on the piano) is 880 cycles per second (double the frequency). These two "A" notes
sound similar to us, but one is higher. And of course there's next higher A at 1760 cycles, and
higher still .. each time doubling the frequency.
Amplitude is the word for the height and depth that the signal makes on each cycle,
corresponding to loudness. Big vertical swings are loud, small vertical swings are quiet. Or
phrased as air pressure, bigger changes in air pressure sound louder. The timbre of the sound is
the fine pattern of shapes and wiggles that can seen on the signal. So a flute "A" note has a
timbre, varying a little around the basic 440 cycle pattern, and a trumpet playing that same note
has a different timbre on the basic 440 cycle pattern.
https://web.stanford.edu/class/cs101/analog-digital-1.html 5/11
12/26/2017 Analog and Digital - Analog
Here is a high-C note, 3 octaves above the low-C. You can see that the frequency is much higher ..
many more cycles per second.
https://web.stanford.edu/class/cs101/analog-digital-1.html 6/11
12/26/2017 Analog and Digital - Analog
that the ear can take in this jumbled signal, and pull out and hear the constituents.
As another example, here is low-C and the C note one octave higher:
https://web.stanford.edu/class/cs101/analog-digital-1.html 7/11
12/26/2017 Analog and Digital - Analog
What does the sum of the above two look like? To convince yourself of the sum behavior, you can
draw the two signals on graph paper, manually measure the heights and do the addition, to verify
that the sum indeed looks like this:
Noise-Cancelling Headphones
This "sum" idea is how noise-cancelling headphones work -- detecting the ambient sound and
creating an exactly opposite sound (multiplying by -1) to feed into your ear, so they cancel out
leaving silence.
https://web.stanford.edu/class/cs101/analog-digital-1.html 8/11
12/26/2017 Analog and Digital - Analog
Analog Technology
Analog is the pre-digital way of transmitting or storing a signal. Examples:
A person talks into the phone receiver. Their voice is vibrations in the air -- a signal.
The phone receiver contains a microphone where the vibrations in the air move a tiny coil of wire.
The movement of the wires sets up tiny electrical flow that is in one-to-one correspondence with
the air vibrations. Essentially we translate a signal in the air, to an analogous signal of electricity in
wires.
The electrical signal travels out of the house to the phone company, gets amplified etc. and is
eventually delivered to the phone at the other end,.
There the electricity goes into a speaker -- a speaker is just an arrangement of wires and magnets
to translate electrical variations back to sound (the reverse of the microphone).
The key feature of analog signaling is 1-1 correspondence .. variations (a signal) in one medium
such as sound in the air, are translated to variations in some other domain like electricity in wires.
The signals in the different domains are in 1-1 correspondence -- one goes up, the other goes up.
Analog - LP Records
Analog LP record
Sound wave is recorded as hills and valleys in the plastic groove
Playback needle rides in the groove, jiggles up and down,
makes a little electrical signal
The old LP record format is totally analog. The sound signal is recorded as little hills and valleys in
the plastic groove that runs around the record. For playback, a needle sits in the groove, the
record spins, and the hills and valleys make tiny up and down movements of the needle. The
needle is hooked up, in essence, to a microphone-like device which translates the up-down
movement of the needle to an electrical signal, which eventually is sent to the speakers to
translate the signal back into sound.
https://web.stanford.edu/class/cs101/analog-digital-1.html 10/11
12/26/2017 Analog and Digital - Analog
What do "errors" look like in an analog system? The signal you care about is translated from sound
to electricity and so on. With each translation step, little errors creep in. The microphone has a
little stiffness, the wires don't carry the signal perfectly, and so on. The errors are called "noise" --
you can imagine the pure sound signal you wanted but it's been distorted by little up/down errors
-- like fuzzy variations around the true signal.
This is the "hiss" you hear on the phone line or an AM radio or a cassette tape .. all analog
technologies. Why do digital translations of music sound so much better?
https://web.stanford.edu/class/cs101/analog-digital-1.html 11/11