-
Okay. So, today what I wanna talk about in
this section is analog versus digital.
-
And, I think of those words, like, you
know they sorta come up; I think they're
-
sorta like the word entropy, like, no
one's... It's hard to know exactly what
-
they mean. So I really liked today's
lecture of the section because I can show
-
you how those things really work, and in a
way, I think, it is something that every
-
day of your life from here on now, you'll
know something about how audio or all
-
these thing, they're just very ubiquitous,
how they work. So, let me get the, one of
-
the screen down here [sound]. So, I'm
going to start off. A really, really
-
question I want to address is a, what is
analog versus digital? And digital is how
-
things work in a computer so that, that's
where I want to get, so I'll start off
-
with a, analog. So the world is basically
analog, and what does that mean? Well. The
-
simplest case and the running example I'm
gonna use today is sound. So, What does
-
sound look like, how does sound work? You
know the sound of my voice or music or
-
something. So, sound is actually just
pressure waves in the air, just little
-
minute increases or decreases in pressure.
And inevitably it's described as traveling
-
up through the air like if you threw a
pebble in a pond and you sort of saw the
-
waves traveling out. So here is my, my
made up example of what a sound wave might
-
look like. It turns out many of the sounds
that are used in day to day life do have
-
this kind of repetitive pattern. And so
that'll, that'll come up. So oh here's a,
-
here's a slightly better example. So how
does a violin work? [laugh] No expenses
-
been spared on this artwork. Yeah
question. Oh, I'm sorry, yeah, I, I
-
haven't put this on the web page yet. I
will after class. But there is a. Please.
-
Sorry. So, a violin you know, a violin is
a musical instrument you can play it. But,
-
how does that work? Well the way the
violin works is that there is these
-
strings and they are attached to this
hollow wooden body And as the bow is drawn
-
across the strings. You know, they're
metal and they're under tension. And they,
-
they vibrate as some, at, at a repeating,
at sort of a repeating frequency. And
-
really the gist of it is that it; it
vibrates the wood of the violin. And so
-
the wood will flex out a little bit and
flex in a little bit. And so, it's sort of
-
like a drum where you can kind of think of
it as kind of bumping up and down. And
-
what that does is it creates little
pressure waves in the air. And so, those
-
travel out in all directions And event.
So, so, there's the signal in the violin.
-
I'm drawing it like this little wave. You
know what's going on? Half a millimeter up
-
and a half a millimeter down And then that
translates into the air where it's going
-
out as these little pressure waves. And
the thing about analog is that the shapes
-
are the same. So that on the violin if it
kind of a little down a [inaudible] you
-
know where, and we could have sounds with
different sharpness's and different
-
frequencies and a, that, that is
reproduced in the air basically. So it's
-
travelling out in the air and eventually
gets to your, you know, your [inaudible].
-
And you're listening and in your ear
there's the little eardrum, right, which
-
is very much like a, a drum head and the
air pushes against it and so it pushes it
-
in a little bit, out a little bit. So
that. I mean partly it's just my low
-
quality explanation of how violin sound
works. But also that's very, analog. That
-
you have something on the violin but
[inaudible] it would, then it translates
-
to some sort of other medium in the air,
but you sorta keep the shape, it travels
-
in the air for a while and starts to get
to your ear drum, and again in the ear
-
drum the shape is preserved. That is the
fundamental quality of analog processes;
-
you're sorta jumping from step to step but
keeping the shape. So to show you how this
-
works, we'll do some demos and experiments
and stuff. I'm gonna use a device called
-
an oscilloscope. A sure sign that your,
that nerds are near is if there's an
-
oscilloscope. Oscilloscopes are, are
really neat in my, you know, in my
-
opinion. Really neat device and it, it
very much gets this idea of analog. What
-
an oscilloscope does is it takes in
electricity on a pair of wires. And it
-
just looks at the wires, and it observes
the, the signal of voltage kinda going up
-
or down over time. It looks at that
signal. And it reproduces it on screen so
-
you can't, something which is very
abstract right I, I gesture my hands and I
-
say well there's the sand coming out of
the violin but it's all just hand waving.
-
This [inaudible] scope makes it real it
takes a signal out of the wire and it
-
draws it makes us visualize, I think we're
very visual creatures and so [inaudible]
-
kind of amazing you know very handy. This
things had been around for actually a long
-
time since I think the 1930's and the one
I'm going to use today When I switch this
-
screen here. [cough] [sound] This is
actually a, a digital oscilloscope hooked
-
up to my computer just cause it makes it
easy to display stuff. But it is at the
-
end of the day an oscilloscope. So this is
the oscilloscope out-scope, output right
-
now what its showing is nothing. Oh
actually I'm sorry let me switch back and
-
explain a little bit more how this works.
So the way the oscilloscope works is it
-
grabs the signal off the wire and it, it
draws it. And, the way the [inaudible]
-
works is that it leaves the signal up
there for maybe a tenth of a second. It
-
freezes it. And then it grabs another
signal off your hearing. And it puts that
-
one up. So, it doesn't quite track what's
on the wire in real time. There's maybe a
-
half second delay because that's the way
this one works. So what I've got for my
-
demo here is I've got this. And as will
become obvious, I'm no musician. But I, I
-
have this synthesizer hooked up. And so
the synthesizer is hooked up to the
-
speakers, so I can make sounds and kind of
play around with them, but it's also
-
hooked up to the [inaudible] scope. So
what it is what it's like two of the five
-
senses. Right? So, you can hear it, but
you can also see it. And so then we can
-
talk about what is a wave, what is a
signal? Alrighty [inaudible]. This is
-
where they complicated demo. This is where
I guess I need to appeal to the demo gods
-
for my complicated set up here. Let's
slide this over so I can actually reach
-
it. Alright y, so let's try this. So my
first claim, or I'll just start, try
-
making a sound here. Here we go. So this
is a, a, a [inaudible] math class, this is
-
a sine wave. And a sign wave, right this
sort of perfect mathematical wave has this
-
kind of boring, perfect bell like sound.
And so, that's the. That is the
-
electricity coming off the synthesizer
which is driving the speakers and it's
-
also making that thing. So let me try, so
what I wanna do just first off is just
-
talk about what are the properties of a
signal like that. I'm sometimes I'll use
-
the word signal, that's kind of the term
for this sort of. Data that I want to play
-
around with. Or I might use the word wave,
er [inaudible] but really what I'm talking
-
about here is signals. So, the, I'm going
to talk about some of the qualities that
-
signals have the first quality I'll talk
about is er, frequency. So this one, this
-
is kind of a low note. And so, remember
what I said, with the oscilloscope is that
-
it grabs a wave and then it shows it to
you again maybe a hundredth of a second
-
later or whatever, maybe a tenth of a
second later. So those variations in
-
pressure, that's actually maybe a hundred
per second, something like that, and we're
-
just seeing it very zoomed in, so the
width of the screen in this case I think
-
is a. A hundredth of a second across and
so really that's very, you know very
-
quickly and so most a human speeds things
like that, they tend to be in the range er
-
50 cycles per second up to maybe 20,000
cycles per second. Alright, so the first
-
quality I want to talk about, I just used
the phrase cycles per second but I never
-
explained it, is frequency. So if I go up.
So something where there is more and I'm
-
gonna, we are gonna say, this is more
cycles per seconds. How many ups and downs
-
do we pack into what did I say this was a
100th of a second. So when there's more in
-
there. [sound]. That's what you think of
as higher, when you have a note which is
-
higher or lower or whatever. Also this is
higher so it's kinda like, this is kinda
-
irritating. Okay, sorry, we'll
[inaudible]. [laugh]. All the dogs are
-
gonna like leave the building. So that's
what frequency is. You have just a greater
-
number of cycles per second. And there's
actually. I'm gonna go a... Well, let's
-
talk about music a little bit. So when you
go up one octave, so that's C to this one,
-
to this one. What you think of is kind of
a natural sounds repercussion, that's
-
exactly a doubling. So, if I look at the
number of cycles there and I go up an
-
octave, it's exactly, exactly a factor of
two. We can go up, into the dog range but
-
I won't. Alright, that is one quality of
signal of sound. Another [inaudible] which
-
is kinda obvious is Official vocabulary
word is amplitude, so. In a very analogue
-
sense, the height that, that is going up
and down corresponds to how the, how big
-
the pressure wave is. Right, how hard is
the speaker, the synthesizer pushing on
-
the air? So if I were to just turn it
down. It just like, goes down. So that's
-
what, that's what loud and soft is. Loud
is just, [inaudible], just like you know,
-
going out a little harder. So this leaves
me with the most kind of baffling quality
-
which is called tamber. And that just
refers to the shape of the wave, the
-
little curly cues, whatever. And the sine
wave is like there's no timbre. It's just
-
like the most vanilla sound possible. So,
I'm gonna switch the synthesizer. To do
-
like, cheesy, pan flute sound [sound] and
what you see, I don't think you'd tell,
-
that's the same cycles per second I was
doing before. It's actually the same
-
frequency, it's the same note, but it has
this flute timbre on it, all the little
-
curly cues and stuff on it. And what is
amazing is how the brain, that's what your
-
brain is getting. Those little curly cues,
and bumps and waggles and God knows what,
-
and your brain takes that in and what it
hears is. [sound] flute [laugh] but when
-
it hears this one it's like. >> Oh yeah,
sign waves. >> And, and what. >> That's
-
all a little basic to me... >> Well
certainly when we look at it visually just
-
as pixels it sort of. Yeah. I have new
found respect for the ear, and the brain.
-
I really the brain, obviously the brain,
The brain helps out there. Alright, So
-
what do we have there Frequency,
amplitude, timber. That's just like
-
classic, classic stuff to know about,
about these sorts of signals. Alright, so
-
what I want to talk about Is Another
question about how sound works and I'll go
-
back to my [inaudible] here, which is
there is just one air. Like in this room,
-
there is one body of air and all the
sounds in here, basically me talking and
-
you all clickety clacketing like [laugh]
[inaudible] paying attention or whatever.
-
It's all sharing the one air. And so the
question I want to get out is well how is
-
it, what happens if multiple sounds are
going on in the air at the same time.
-
Alright, if there's, someone's talking,
and then there's a low note, and a high
-
note and you can [inaudible], oh, maybe
they just sort of obliterate each other.
-
But, that's not true, really [inaudible]
you can hear, obviously, you can here
-
multiple things at the same time. And so I
wanna get a little bit is like, how does
-
that work? How do multiple sounds fit into
the one air? And so I'm gonna do that by
-
playing multiple notes at one time.
Alright, so I'm going to start off with.
-
Okay yes, we've seen this enough times, my
low note, the, the sign wave, so what
-
would happen if I played that one, and
let's say this one at the same time. And
-
I'll tell. I'll, I'll, I'll tell you, and
then we'll look at it. The answer is
-
addition. The pressure waves add on top of
each other. So, there might be one place
-
where one wave is kind of high and other
is also kind of high, so they add together
-
and they make it like even higher, and
there might be other places where one wave
-
is kind of high and other is kind of low,
so it is just rhythmetic. How do they add
-
toge ther, they make composite wave that
has both sounds in it. And, um... So it
-
just happens which bring out very neatly
and visually so I'll start with the low
-
one. And then here's the high one. [sound]
And I'll just do it at the same time.
-
[sound] Oh well, that doesn't come out
quite perfect there. Let me, let me try
-
one even a little higher. [sound] So
there's my low one. [sound] There's my
-
high one. If I do it at the same time or
if you can kinda see. There're sort of the
-
low one is in there but the just map on
top of it is this high one. Okay I like
-
everyone would just close your eyes for a
second. Just humor me. So now just isolate
-
you can here just listen to the high note.
Right You can recognize there is a height
-
note there or if you want you can also
here that there's the low note. Alright
-
you can open your eyes. So looking back
[sound] your brain is just getting the
-
signal. And this is the amazing part. Your
brain gets that, and it can parse out
-
[sound] The two sounds that are going into
to it. This again gets. I'm impressed with
-
the brain how it can like pull that stuff
apart. Allrighty, So I'll show you there's
-
a If you wanted to sort of prove, or show
for yourself that it's just addition you
-
can actually do it with graph paper. Where
you, you could sort of graph this note,
-
which is this one. And then you could
graph the note that's just one octave
-
higher. So this one and then this one,
Just, just 2X. And then with the graph
-
paper, you could sorta add up the
components. So where they're both high
-
make it high. And where they're both low,
make it low. And it and what you'll find
-
is that you get. The sort of a, this is
the classical one octave apart shape and
-
so only guys optional exercise that you
could, you could, you could sort of show
-
that I'm not just making this up.
Alrighty, So let me show you a couple
-
other a couple other interesting fact
about this summing together of sounds
-
There's sort of an eerie relationship
between mathematics and sounds, and in
-
particular sounds that sound good and
sounds th at don't sound good and this is
-
er, I guess the ancient Greeks were
captivated by this and it is kind of
-
magical. So, what you think of as a chord
in music, what sounds good is when the
-
peaks and valleys of two different sounds
that you're going to add together, they
-
kind of match up. So, for example, it's
kind of obvious that if I take this note.
-
And then I exactly double the frequency,
exactly double, then the peaks and the
-
valleys are gonna match up perfectly. And
so in fact, those sound pretty good
-
together So that's really, that's what a
chord is, is when mathematically it kind
-
of divides evenly so the things match up.
So we can look at the other side, well so
-
wait, what sounds bad? And the way to get
it to sound bad is to have one sound be,
-
let's say, at 100 cycles per second. So
that, you know, that's the spacing of the
-
piece of valleys. And have another sound
which is maybe 100, 100 one cycles per
-
second. Just a little bit off. And what
you'll find is then the peaks and the
-
valleys, they almost never coincide. The
thing is just staggered and it makes kind
-
of a mess. And what's neat about that. Is
that there's something in your brain. So
-
here like [sound] there's a chord where
they match up pretty well. Then I'm gonna
-
add on one. [sound]. Well like it doesn't
match. That's discard And what's amazing
-
is how like, it's not just bothering
everyone. It's like "I'm not happy" and
-
then if I just go up, I just go up a
little bit so it matches, then like "aah,
-
that sounds good". [laugh] So that's math,
chord and discord. Alright, so let me show
-
you. I want to talk about that. You know,
we [inaudible] that. So that's just a
-
signal, waves, things like that. So let me
bring this over to technology. And
-
eventually I want to get at basically
like, how a CD player works. Or the CD
-
player, I guess that an antique. So we'll
also talk about how mp3's work. So for
-
starters, I got, if I'm gonna talk about
Analog versus digital. I, I personally
-
want to talk about analog briefly. We
talked about this a little bit with my
-
viol in example. So, I'll talk about
there's the, the original telephone
-
system, the Alexander Grahambel model.
[cough] and I talked about analog a little
-
bit before so this very much follows that
pattern. The way the original phone system
-
work is, you know, we've got the person on
the left there and they speak, so they
-
make pressure waves in the air and it hits
a microphone. And. I'm not going into too
-
much detail what a microphone does but
basically it has little magnet arranged
-
next to a diaphragm that can be pushed by
the air and so as the air moves the little
-
diaphragm back and forth it makes a little
tiny electrical current. And so the result
-
is. Right, that's analog. It means when
the air cone is pushed a little bit one
-
way it's gonna make the electricity go a
little bit one way. When the air cone goes
-
the other way the electricity's gonna go a
little bit the other way. And so we end up
-
with this perfect. Essentially what the
microphone does is, is it's an analog
-
translator. It translates from wave in air
pressure over to little pattern of
-
electricity in the wires. And that's like,
that's the classic analog step. Alright,
-
so a telephone that takes the electricity
by having transformed the signal into
-
electricity, well now it can go on the
wires. And so it goes down the wires, now
-
in reality, the signal is so weak, so
there's gonna be some amplification of the
-
electricity, transistors, we talked about
before. So it goes down the wires, and
-
eventually gets to the other end where it
gets to a speaker. A speaker is just the
-
reverse of a microphone. So the speaker
takes in the electricity, and it has an
-
arrangement of magnets and cones,
whatever. So that then the electricity
-
pushes the cone out or in a little bit.
And so it basically recreates the pressure
-
wave and so then, then the sound comes
out. So this is the original design of the
-
telephone system, and what's funny, is
that. Not you guys obviously but you know,
-
your parents, people actually have phones
in their houses. The last mile of the
-
phone system, It st ill works this way.
Like once the standard was kinda set and
-
you know, everybody had all these zillions
of phones out there, it was hard just to
-
have something switch day, oh so
[inaudible] works differently, it's
-
sometimes called a network effect, but
yes, there's this tremendous inertia,
-
where the phone, even though the Central
Office of the phone company now works
-
completely differently, the end part is
still compatible like the way it's always
-
been. Alright, so that is your classic
analog structure which is mostly so we can
-
make fun of it a little bit. Alright, So
what I want to talk about is noise, hiss.
-
Like how is it that analog doesn't sound
so great. So, I want you to image this
-
signal: This is, you know, I call someone
up and I have this beautiful bell like
-
signing voice and I just sing this like
perfect sign wave. And I just, I just want
-
it to be enjoyed by the person at the
other end of the phone. So what I'm going
-
to do... Well, so, let, let's say I sing
that into the microphone, and it's
-
perfect... What comes out at the other
end? Right, it goes down the wire, it goes
-
through the microphone, down the wires,
and then it [inaudible] and then it comes
-
down the speakers in the other end. And
the answer is it doesn't come out looking
-
like that. What happens is really there's
a little bit of what we are going to call
-
noise. A little bit of error. And I'm
gonna. This isn't real; this is just me
-
drawing a model of air. But you can think
of the air as sort of like fuzz around
-
where the signal was supposed to be. And
the sources of error are many right? Well
-
maybe the microphone the paper cone was a
little rigid I mean it didn't quite flex
-
perfectly for my beautiful singing. And
then the magnet has certain electrical
-
properties that kinda shape the, the
pattern electricity it can make. And then
-
the wire has certain qualities where it's.
Most of the signals go through but it. The
-
shape of it kind of gets distorted by the
wire. All electrical components do distort
-
the shape a little bit as the signal goes
thro ugh there. And so what I get out of
-
the other side you can, you can think of
it as like well the signal, you can see
-
the signal. But there's this, and then the
term is noise. There's this noise kind of
-
added on top of it. And I'll tell you,
noise has a distinctive sound. You have
-
all heard noise. Noise is the hiss. It's
that, [sound], kinda like. So think of
-
analog technologies you've used, right? So
if you ever had, does anyone here have,
-
like, cassette tapes? Maybe you got'em
from your grandparents or something,
-
Anyway, when you play back cassette tapes,
mostly, the music would be there. But if
-
you turn it up loud enough, or if there
was a quiet station, or if there was a
-
quiet section, then you'd hear this, like,
[sound]. And that is exactly, it's the
-
noise from the tape and the magnets All
these sort of various layers that the
-
analog was going through. There's this
noise added on top. So er, phones actually
-
have this cuz phones are this, sort of,
comically old technology for that last
-
while, And so, that, or anyway, that's why
Skype sounds so much better than actually,
-
actually using a phone. Okay, so that's,
that's a problem other examples. I guess
-
VHS tapes. Those are analog. So in that
case, the hiss sort of shows up as,
-
[inaudible], pure hiss, pure noise in
video is that snow look where the pixels
-
are just kind of randomly flashing between
black and white and color and stuff. Okay,
-
so that's, whatever, analog. You can do
pretty well but it's not gonna. Oh, AM
-
radio. See, all, I need to think of a
technology you guys actually use that's
-
analog. So [inaudible] product for the
future Am radio has a significant amount
-
of hiss.