Digital audio works by converting analog sound waves into digital data through two key parameters: sample frequency (the number of times per second the system captures the sound's amplitude level) and bit depth (the number of different volume levels that can be recorded). According to the Nyquist-Shannon theorem, the sampling rate must be at least twice the highest frequency humans can hear (around 22,050 Hz), which is why industry standards use 44.1 kHz or 48 kHz. Bit depth determines the resolution of each sample, with 16-bit providing 65,536 levels and 24-bit providing over 16 million levels, allowing professional recordings to capture subtle dynamic changes without distortion.
Digital Audio Sampling: Bit Depth & Sample Rate Explained
Added:The Air moves backwards and forwards like that across a room. I would say and Moves in some kind of wave pattern across a room and it will hit your Eardrum and vibrate something which turns it into some kind of electrical signal which your brain decodes and you go oh that's that note or that's that note when we come to get that sound into a computer the Simplest way would be to have a microphone which basically turns sound into some kind of voltage Badly Drawn wave like that what I'm [interested] is is how?
Once that voltage gets down the cable You can put it into something like [a] sound card. Here's one that I've [got] sitting up here I've actually got a few lying around and they convert What would be an analog signal something coming through a guitar lead or a microphone cable?
And they'll turn into something that a computer can use which is basically ones and zeros a digital signal there are two numbers that you associate with [Wav] file one of which is called the bit depth, and then you've got another thing which is called the sample frequency So basically these are the two parameters you use to Convert an analog signal to a digital signal I'll start with the sample frequency [the] one I'll write down second And that is basically the [number] of times per second that the computer will stab in and go What is this level here, so if we say?
Yeah, there's a number of different levels. You know one going up to whatever this Axis [here] is time And it will go across here and and stab in there and go that's the level at that point And that's the level at that point That's the level at that point and it will record these as numbers So you might get like 5 6 8 so the number of slices per second that it does?
is the sample frequency and obviously the more of those you put in per second in theory the better quality the [Audio] is going to be now for a big wave like this you don't need a particularly high sample frequency Because what you're getting there [are] tiny little details you could probably stab in two or three times in each cycle But obviously if you start to get a wave that's much more Like that if you only sample there And then the next sample you took with a you're going to miss all of that data there It's just going to end up cutting off what you consider the treble [the] high frequencies So the higher notes would just be cut off I'm talking about physical high frequency data So I'm talking about high notes like like screeching notes you know if you like run your You have two bits of glass scraping against each other it produces a really high Frequency which hurts your ears that is a real top and note and something. That's like a Real load Sonic boom sort of note. That's a real low frequency because it Physically has a longer wavelength and the [high-end] frequencies have a really short wavelength now. We only hear up to around 22,000 hertz so that we call that 22 k but there's the two main industry standards that use our 44.1 K and Forty-eight K and when I say k that's thousand cycles per second. I'm going to put in the kilohertz there, so the reason that 44.1 was initially chosen because it's a strange number that isn't it 44.1. I mean where does [that] Confer basically the highest that they?
Measured at the time. I mean, I don't know the exact science on this I'll probably be corrected, but the highest that people thought people could hear was twenty two Thousand and Fifty Hertz and to get the full cycle of a 22050 hurt wave you need to double the sampling frequency they picked forty four Thousand one Hundred Hertz as the sample frequency to be able to recreate anything that we can hear as human beings for various reasons that got changed for video so CDS and Audio Mp3s, and other such things generally come out other both CDS definitely doing mp3s most of the time come out at forty four point one and if you put a DVd or a blu-ray in your Player you will be listening to audio at 48 K so computers and other devices you know digital high fiims other stuff like that need to be readily available to convert between Those now there's other nowadays who use 96k some microphones can't hear as high as the human ear so maybe they're not picking anything up above 16 K so sampling a 44.1 [or] 48 K is well above what you need to pick up the sound from that particular?
Microphone now the second thing is the bit depth and the bit depth is the one that to me does make quite an important difference [so] when you get a final product [on] [a] cD or you get it on an or DVd or a blu-ray or something like that most of the audio is at 16 bits which basically means that between the top level of The plus here and the bottom level of the minus there the levels that you can have the different Volume [levels] that you can have you can only have at 16 bits [65,536] you'd think that's enough different levels, but realistically. It's kind of half that Because you're dealing with a wave here. It comes down below the center line, and it comes back above so really you're getting half of that and half of that, so you get half of 65,536 above and half of that below with the zero line in the middle so you [probably] think that [Thirty-two], and a bit thousand looking to do the exact that's 32 and a bit thousand levels would be enough and for a final piece of finished music that That is kind of mastered and ready to go out it. Probably is which is why that's why we get you know That's the CD standard. That's the DVD standard, but when you're actually dealing with the individual instruments you might end up with a drummer Who's playing really loudly and hitting away really loudly?
And then right at the end he's just doing a little cymbal swell [and] there's the tiniest little amount of volume going on and you [just] want that volume to stay right to the end till the cymbal stops ringing and unfortunately when you're dealing with those raw Files that haven't been mixed, and there's not a lot [of] other things going on if you record it [16-bit] You can really hear it being grainy because it's all very well saying when you're dealing with a wave That's like that you've got loads and loads and loads and loads and loads I mean You could have 32 and a bit thousand levels there to deal with if the way that you're dealing with suddenly becomes only that big You're only dealing with that amount of the space So this is maybe the the drummer hitting I don't know a symbol really hard there at the beginning and then it dies out Yeah, and ten seconds after you hit the symbol which it's died out and it's become really quiet And you want to pick up that noise as as Perfectly as possible without it becoming distorted and fuzzy because what ends up [happening]?
Is you end up creating a wave and you get all these points and then when the computer puts it out?
It puts them as points, and then it's got draw lines between these points, and if you haven't got enough levels you end up with Effectively square waves which don't sound particularly nice they said?
You get quite a buzzy [sound] to them so if you hear right on the end of a fade out of a track And you turn it up really loud in your hi-fi you might be able to hear the song starting to get a bit A bit dizzy and a bit fizzy at the top end and that's effectively what's happening here so when you're doing recording if you're trying to record a drum kit, and then a guitar and then a vocal and And going through and actually layering up as a song you generally want to be recording at 24 bits so for a 24 bit signal we end up with 16,777,216 different levels Which is why on a professional level you record everything at 24-bit you do your mixing and Generally within the audio software it Passes it from one place [to] another actually at 32 bits You've got even more headroom to move so head rooms like space. Yes, space because Let's say you've got a wave there And then you've got another wave here and you add the two together in a piece of software It's going to produce a wave that's a lot bigger now If that is heating the top [and] the bottom there, and that's hitting the top of the bottom there What does happen?
What ends up happening is they get squared off you'd add them together and that might be bigger like that And then that would [just] be cut off the top that we cut off the bottom because these become No-go areas for the software because you can't get a number that's bigger than the amount of bits so you end up with a way that's like that and then it squares off and then it comes [down] and it's As off and then it goes back [up] [and] it squares off And it sounds distorted so so [shall] we give one example of how that might sound I'm going to get you to say hello Hello Right so that's how you horrendous in my ears that's called digital clipping when you use a digital audio workstation [you're] summing together Wav files constantly because you might have a bass drum mic a snare drum mic a hi-hat mic Two or three Tom mics two overheads two room mics a bass guitar two guitars vocals whatever, so you could have twenty four Thirty six seventy fifty odd tracks of information and with backing vocals And you're summing them all together and the idea being is if you've been a good engineer You will have recorded them with enough level that You're not keeping the level like that because you don't want the level really small because it will sound Grainy as we previously discussed But you want to send them in with enough headroom as well, so that they don't clip But when you sum all these things together if you've got things that are only a little bit off the top Suddenly you're going to produce a signal which is far in excess of what?
24-bit is capable of doing so internally within the programs they are passing the Wav files at [32-bit] to make up for the fact that you're summing these all together and then the idea being is Some piece of software at the end will show you that it's clipping and you put in a plug in and turn the whole Volume down on the whole thing to get it back, so your final output [ends] up still sitting within the boundaries of what 24-bit is now?
Realistically if you go the tiniest amount over what it is and you get the tiniest amount of digital clipping You know if you were recording a drum kit on one snare hit go slightly over You're not going to stop the whole recording it But if you were recording a guitar and all the way through [the] whole thing was [just] squaring everything off it might sound pretty nasty So you have to make these kind of fundamental decisions?
What is going to be your sample frequency and what is going to be your bit rate and generally for most applications?
[you'd] be using 24 bits and 48 k or possibly 44.1 You end up with all [sorts] of annoying?
Artifacts when you're converting from one thing to another you're either down scaling or up scaling you're [either] throwing away data or you're adding in Data, and you're having to artificially make the data so converting between 48 Km 44.1 Vice versa, it's not the bulk stuff You hear it's the the symbols and the real higher in frequencies the treble stuff?
That's where you're going to lose the detail by doing that but there's great algorithms out there that do all that stuff I don't that's run it through a software click the button it does it?
We'd like to thank whisper syNC for voice and Amazon inaudible innovation for sponsoring this episode of computer file Do you wish you had more time to read you know that point?
We're really a good bit in the book, but somebody rings or a reminder those awful your alarm goes off And you just have to leave well whisper sync the voice means you can stop reading and switch to listening to your book and Exactly the same point that you've just left off find out more at amazon.com Slash [computerphile] when you buy the [kindle] book you just select add audible companion you can add narration to over 60,000 kindle bestsellers and popular titles just [check] out amazon.com computer valve for the full list Thanks once again to them for sponsoring [computerphile] This and your is what would normally be your compass heading So it's your your your magnetic compass heading the phone can detect all of those aspects the trick is then how we pass information?
to the plane itself
Up Next

Information Theory Explained: Shannon Entropy & Data Compression
@Computerphile
181K views•2022-05-25

BitTorrent Protocol Explained: Piece Selection & Peer Choking
@StevenGordonAU
481 views•2013-02-22

Monads in Haskell Explained: Maybe Monad & Effects
@Computerphile
647K views•2017-11-24

Enigma Machine Mechanics: WWII Encryption Explained
@JaredOwen
13.2M views•2021-12-11
Related Study Plans & Knowledge Roadmaps
Structured learning paths in Computer Science


































