Dumb question: Does a PCM sample really represent recorded sound?

As far as I can understand, a sample of 16-bit unsigned PCM data is just a number between 0 and 65,535 representing the amplitude of vibration detected by the microphone. At 44.1 kHz, this sample represents a snapshot of recorded audio at 22.7 microsecond intervals.

What I can't wrap my head around is how this single 44,100th of a second slice can represent/distinguish a dog's bark, or a mix of multiple instruments. Is a succession of vibration levels really all it takes to represent real sound?

Posted Sep 4, 2020, 6:32 AM UTC · edited

239
Chilton_Squid•

how this single 44,100th of a second slice can represent/distinguish a dog's bark, or a mix of multiple instruments

It can't, it's just a number used for plotting a waveform. It's the hundreds of thousands of other samples around it which change what you hear.

Ignoring recording and digital, all sound is just air moving, that doesn't mean it all sounds the same.

13
ronCYAOP•

Reading through these responses, I'm understanding this a lot more: the first point in a line says nothing about the length or angle of the line, it's the difference in X and Y to the second point that defines its form. An audio sample is just one point and its form (wave shape) defines its sound.

Thank you!

0
EightOhmsProfessional•

I find one way to help convince myself that all the information can truly be captured in a series of values is thinking about how sound is produced by a speaker and how you hear in in your ear.

There are only two properties about a speaker that change that allow it to reproduce different sounds.

  • How far it has moved
  • and how often it moves

Both of those things are clearly captured in the samples.

Then think about your ear. Every sound you hear is through your ear drum. That's just a single membrane that moves back and forth, just like a speaker.

So as long as you can capture and reproduce enough information to map out how that membrane moves over time, you can recreate the sound.

3
ronCYAOP•

Get outta my mind! I was just thinking/realising this half an hour ago! You are right it becomes very simple to accept when you boil it down like that. I hope someone else with the same question as me stumbles on your explanation because you've laid it out better than I could have. You live up to your flair :P

0
Chilton_Squid•

That's exactly right.

1
Chaos_Klaus•

At 44.1 kHz, this sample represents a snapshot of recorded audio at 22.7 microsecond intervals.

No. Because one sample is not a time interval. It's just one discrete point. That's the fundamental principle of digital audio. Things are discretely quantized. Many samples together will prefectly represent a continuous waveform as long as the bandwidth limitation is observed. That's what the sampling theorem states.

how this single 44,100th of a second slice can represent/distinguish a dog's bark, or a mix of multiple instruments.

It can't. But even if you had 1000 Samples, you probably wouldn't be able to tell the difference. That's because this information is encoded in the change of signal over time and you need a certain amount of samples to make that information clear to our minds.

It's much like with text. A single letter does not contain much information about a story. A few letters will form a word, which still doesn't tell you if you are looking at a Stephen King novel or the local news. Looking at an even larger amount of letters will give you more and more context.

4
ronCYAOP•

Really loved this explanation, that is such a great analogy! And thank you, now I get how many thousands of values combine to form a 'shape'/sound and also why it would take many thousands of them. Very much appreciated.

1
ArkyBeagle•

When I tried it last, the "Digital Show and Tell" video by "Monty" Montgomery, hosted at xipf.org didn't work but see if you can find it somewhere.

This goes back to theory work done by Claude Shannon in the 1930s ( and of course, work on which that depends ).

3

https://m.youtube.com/watch?v=cIQ9IXSUzuM

Like the link/page didn't work? I think this is the one you were looking for... I was just digging through my bookmarks for it.

u/ronCYA, it's a really good video if you haven't seen it.

4
ArkyBeagle•

Just to clarify ( it's a bit of a warning :)

The video link hosted at xpif.org caused me to have to hard boot a Win10 machine for some reason - video on the machine I'd tried it on went black and I couldn't even run Task Manager.

The YouTube link you provided seems wonderfully fine :)

2
ronCYAOP•

Haha dang. They're directly embedding webm videos so perhaps it's a codec/browser issue?

2
ArkyBeagle•

Heck if I know. I just know MY COMPUTER WENT BLIND AAAAAAAHHHH! AAAAAAAH! AAAAAH! :)

1
ronCYAOP•

I had not seen it, so I was thoroughly amazed. The XIPF page worked for me but I only found it through the YouTube link you gave. Thank you!

1
ronCYAOP•

That was superb, thank you immensely for recommending that! I love how he just lays out the dots (literally and figuratively!) and shows you how to connect them. The fact he/they wrote a GUI demo for the video shows how much care went into the communication.

Absolutely understood a lot more after that. Even more than I needed for my original question :)

3
ArkyBeagle•

It's arguably the sort of thing that's the reason the Internet was invented : ) . It's marveleous. It's a first-rate presentation.

1
fuzeebear•

A sample does not. Two is the absolute minimum to represent a wave.

2
ronCYAOP•

Ah, that's a good clarification!

2
fuzeebear•

Here, watch this. It's not long, it's really well presented, and you will walk away with a good understanding of how this stuff works. https://xiph.org/video/vid2.shtml

Edit: okay, it's kinda long at 24 minutes, but it's really good. Everyone should watch this and digest the info.

1
rhz10•

A sound (e.g., a dog bark) spans some interval of time. PCM and other encoding methods rely on the sampling of a continuous-time signal associated with the original sound. The samples are generally uniformly-spaced in time. The rate at which samples must be taken depends on the bandwidth of the original signal. In particular, the Sampling Theorem states that that original continuous-time signal can be perfectly reconstructed from a sequence of uniformly spaced samples provided that the sampling rate is twice the bandwidth of the original signal.

So, it's not one sample that's important here; it's the full sequence of (sufficiently frequent) samples taken over the time interval of the original sound that matters.

2
ronCYAOP•

Thank you! That helped make sense of it a lot. I get now that a PCM sample is just a 'defining' point and not a 'describing' point, in the same way in which a point in the outline of a shape says nothing of what the whole shape is, but the entire outline could describe it as a cat.

2
MrElectricNick•

A single PCM sample represents a voltage that will cause your speaker to move a certain amount when played back. It is the continuous change in voltage over time (how much and how quickly the voltage changes) that represents sound.

​

If you have isolated one PCM sample from a microphone recording, that sample represents the amount of air pressure on the diaphragm of the mic in order to generate said voltage for that instant of time. Sound is just the continuous change (and more literally, oscillation) of air pressure over time.

2
ronCYAOP•

I think I needed to accept this more, and also understand that it's quite a large sequence of pressure/voltage points that define just one human-identifiable sound. I was wrongly thinking of samples as very short sounds.

Thanks very much for the needed clarification.

2
HotelEscapism•

Funny how this real audio engineering question from an obviously curious beginner is downvoted to hell, but the low effort list-your-plugins shitposts get a bunch of upvotes

2
[deleted]•

Is a succession of vibration levels really all it takes to represent real sound?

Yes. For 44.1 kHz this is 44,100 samples per second, so a lot of vibration levels. The number of samples per second determines the highest frequency you can capture (Nyquist theorem) and when you convert back to a continuous waveform the analog-to-digital converter connects the sample points in a clever way such that you get back the correct waveform.

1
ronCYAOP•

I believe I underestimated how many possible combinations 44,1000 X 65,535 allowed haha. I can see now how a unique sound could be achieved, thank you for explaining that.

1
mcoombes314•

A single sample does not represent any sound, it represents an amount of static air pressure (by the time it's converted to analog and is being used to move the voice coils of a speaker). You need a group of them to create a change in pressure which we perceive as sound. It's the same as a picture, and single pixel tells you nothing about the image, you need a group of them before getting any meaningful information from it. In audio, the minimum group size is 2 samples, in order to represent a frequency half of the sample rate.

1
ronCYAOP•

Very nicely explained, thank you for that. I didn't grasp before how a particular sound (e.g. 1 millisecond of music) is the result of really quite a large succession of sample points that combine to define a section of the wave. On a technical level I did, but not in practice.

Thanks for helping make sense of it!

1
Soundiot•

" Is a succession of vibration levels really all it takes to represent real sound?" I mean yeah, that is all that sound is. All the sounds around you combine in your ear to form one "wave" which your brain then deconstructs into separate sounds.

1
ronCYAOP•

Thanks, I definitely wasn't fully grasping that. Reading some more after I made this post, I finally understood which part of air pressure exactly correlates to PCM voltage.

1
Soundiot•

Yeah it can be hard to understand how one signal can simultaneously represent many instruments and sounds, until you realize that that is exactly what happens IRL as well.

1

just a number between 0 and 65,535 representing the amplitude of vibration detected by the microphone.

There's more than just the sample itself. There's the samples before, after, and a very strict limit on how those points are connected. If you have three points, you can say they have to be connected an a parabola shape and you get exactly one possible shape. The restriction on shape of sound wave is very similar; it limits the possibility down to exactly one possible output.

(My choice of parabola isn't out of nowhere; the sound wave actually has to be "close" to parabola in shape, but I don't remember the details.)

What is the restriction? The highest frequency represented must be less than 22 kHz. From the input side, an analog filter guarantees that there's no high frequency stuff getting. On the output side, another filter guarantees that none accidentally produced gets out. That turns out to be extremely restrictive. Looking at it from the perspective of samples, that restriction means that the samples carry a whole lot more information than just the sound pressure at a moment in time. Not only does the output have to match in that brief moment, the sound has to match the right shape the whole time in between.

Now how are only 65536 options enough to represent the enormous variety of sounds you could possibly hear? Well, there aren't that few. One ripple of an A440 note takes a hundred samples to happen. That's 6553600 possibilities for the shortest time that could be considered that note (still much shorter than the note could be played).

As strange as it sounds, if your digital→analog electronics were perfect, the first sample of a song actually changes the output even during the time between the last two samples. The effect is so low that it is well below the effect of noise within seconds, but it matters for nearby samples.* There's just a whole lot more information about those 22.7 μs-long moments than 0-65536 seems to suggest.

* The difference between first sample =0 vs. =65535 has an effect that lasts to 1.5 seconds before it falls below the 16 bit depth (-96 dB). I.e. before it matters less than the smallest possible change in amplitude of a 16 bit sample.

1
ronCYAOP•

Wowsers, this is fascinating. Having read the other responses I understand now how samples build after each other to form a combined sound but I hadn't thought about some of these other implications yet. Thanks for even going out of your way to make the parabola on Wolfram Alpha!

That's 6553600 possibilities for the shortest time that could be considered that note

When you put it like that, it's hard not to begin understanding how distinct sounds can be achieved.

There's just a whole lot more information about those 22.7 μs-long moments than 0-65536 seems to suggest.

Really fascinating. Thank you for outlining these facts! A lot to take in but all making sense part by part.

1
Chaos_Klaus•

(My choice of parabola isn't out of nowhere; the sound wave actually has to be "close" to parabola in shape, but I don't remember the details.)

You are conceptually right about the restriction of shape, but it's not parabolic. ;)

In order for sampling to work, the signal needs to be band limited to below the Nyquist frequency, which is half the sample rate. If you have lots of discrete points, you can still find an indefinite amount of continuous waveforms that fit through them. These could wiggle around between the samples like crazy, but in order to wiggle around that much, they'd have to contain high frequency components that allow for steep slopes. It turns out that if you filter out all the stuff above the Nyquist frequency you end up with only one possible waveform that fits through the samples.

1

I'm saying it's not a parabola, but that a Fourier analysis result gives you a bound on the second derivative. Or, to put it another way, there's a limit to how far from that parabola you can get. Again I don't remember the exact details, but once upon a time in PDE, we needed it to justify a step in solving something using the a Fourier series to solve something. I remember it looking a lot like the Taylor Remainder Theorem. If I had to guess on the details, I think that error is highest for these two. That is, I think a second order approximation's error is maximized at the Nyquist frequency, that the area between the parabola and the band-limited signal can't be any larger than it is at Nyquist frequency and 0 dB(FS). (That is the pair of functions linked. I normalized the sample frequency to 1 unit.)

1
Chaos_Klaus•

Ah, I see. I didn't make the connection that you were talking about a taylor polynomial.

Well, technically, you could approximate the shape as closely as you want ... or depending on how many data points you have. With three samples, using a parabola is indeed an obvious choice.

once upon a time in PDE

I can relate. Looking at these things nowadays, I sometimes see connections I didn't see back then ... but mostly I feel embarrassed by all the stuff that I've forgotten already. ;)

1

With three samples, using a parabola is indeed an obvious choice.

And it's a lot easier to relate a parabola to a d^(2)/dt^2 bound than any other interpolant. Constant d^(2)f/dt^2 ain't half bad.

Well, technically, you could approximate the shape as closely as you want ... or depending on how many data points you have.

I think with the way things are set up for digital sampling, you have perfect conditions for Runge's phenomenon, so you've got to be careful with polynomials.

1
dragave•

If Ken Pohlman’s text, Principles of Digital Audio, isn’t on your bookshelf I urge you borrow or purchase a copy. I believe it’s been updated to a sixth edition. The fundamentals sampling and conversions are explained in my 2nd edition (1993).

1
nizzernammer•

Think of an individual sample as a pixel on a screen. By itself, it doesn't mean a lot, but taken in a stream of time for audio, or as multiples in a field for video, our brains can parse this aggregate of information into a whole.

1