Gadgetory


All Cool Mind-blowing Gadgets You Love in One Place

Introduction to digital audio - Gary explains

2016-09-09
her they might have cows seemed from Andrew authority now audio is a big part of this smartphone experience and people spend time and money investing in headphones and wireless headphones and speakers to try to improve that audio experience but of course if the source of your audio is bad then doesn't matter how expensive your equipment is you're still going to get bad quality sound so the question before today is how do computers store audio well let me explain in the real world sound waves travel through the air they arrive at our ears and our brain interprets them into music and speech and other types of sound now we can see those sound waves when we register them on a computer now the biggest difference between the analog world and the digital world is a digital world works on timeslots everything happens in a certain time frame now those time slots might be very very tiny however they are still time thoughts they are not continuous so when we record sound we need to ask ourselves the question how often should we be recording the level of the sound wave the amplitude of the sound wave let me give an example if I said to you I wonder if you could tell me in an email the temperature throughout the day outside your house now you could just go outside your house once look at the temperature and come back and send me a number 23 degrees Celsius well that doesn't tell me how much it is through the day I've lost a lot of information there so I say no can I have something that's a bit more accurate please so maybe you go out and you register it in the morning at lunchtime and in the evening but again that's only three points of data and it's a very very rough so we could say where they measure it every hour now that would give me maybe a better graph could you measure the temperature every 10 minutes could you measure it every minute could you measure it every second so you see as we increase the accuracy we do it more and more often that's exactly the same with sound you could measure it once over a whole second and you would get no information at all you'll just be be rubbish you could start to measure it quicker and quicker and quicker and then you get a better representation of the sound wave now in audio this is the sampling rate how often do you take a sample to see the level of the Soundwave now there are some mathematical theorems that come in here and those important is one called the Nyquist theorem which tells us that to register something we need to use twice the frequency of the sound wave that we're measuring now the human ear can hear up to about 20 kilohertz so we need to use 40 kilohertz as our sampling rate as a bare minimum now cd-quality was 44 point 1 kilohertz and today some systems use 48 kilohertz and those are basically the standard sampling rates for music now there are some situations where people record in a higher sampling rate now I'm talking here about playback through your smartphone or maybe through some other audio equipment if you're doing studio work there may be arguments for recording for sampling at a higher rate but for playback 44.1 or 48 kilohertz are just absolutely fine now the other side of this is you say well what great what measure what gradient are we using to measure this sound wave again I could say to you please go outside every hour and tell me the temperature and you could come back and say it was hot and then it was hot and then it was cold well that doesn't really tell me very much that's just binary information hot or code one bit of information so maybe you could increase your scale maybe in the morning you could come out and say it was very cold by mid morning it was just cold during the afternoon it was hot then late afternoon it was very hot and then he got cold again and then very cold and here I just have four different states that gives me two bits of information well of course if you think about a thermometer when we're measuring temperature maybe there's a hundred or 120 130 different levels that we can measure temperature on maybe even more if we use fractions so with audio we need to have a good system for measuring the level of the audio now eight bits would give us 256 different levels and sixteen bits give us over 65,000 different levels and 24-bit gives us over 16 million different levels now there are some arguments for using 24-bit audio and we'll go into that in a minute however a lot of systems use just 16-bit audio which gives you 65,000 different levels when you are reaching the sound so at forty four thousand times a second a point is plotted on a graph somewhere within a range of 65,000 different points and that is how the sound is recorded and that system is called PCM pulse code modulation now when you have this digital music on your smartphone it needs to be turned back from a digital system into an analogue system but then powers your headphones or a speaker or something else now to do that you need to use something that's called a digital to audio converter and the digital to audio converter the DAC has the job of taking all those reference points of information about the waves in the sound and converting it back again into real sound now there are lots of different technologies involved in doing that however there are a covering important things to realize one is that sometimes you might see diagrams that show kind of the waves as being squares with big steps on them well that's actually not quite true the way DAX work is using interpolation using some filters they are actually able to smooth out the data the sine wave that comes out from that data one of the ways they do that is using over sampling them every time you over sample something you can actually if you double the over sample you can reduce the amount of noise in the audible spectrum by up to 3 dB so actually some - we'll go do lot over sampling and then reduce it back down again to produce the sound wave so there's lots of technologies involved but don't think that Dax are producing kind of these square waves they're not it's all very very smooth now your mobile phone will have a DAC in it and hopefully it will have a high-quality DAC and hopefully it will produce good sound from that digital audio of course the cheaper the phone the charts are the cheaper the component and the chance to have a cheaper the DAC that's why you need to be happy with the DAC that's inside your phone now I mentioned earlier on there was an argument for using 24-bit playback and 24-bit recording now the reason behind it is this all audio circuits produce an amount of now the amount of noise they produce depend on the quality and so on now the best we can produce a day is a hundred and twenty four decibels of signal-to-noise ratio now one hundred and twenty four decibels means 21 bits of information now 21 bits is greater than the 16 bits you find a lot of format and it's coming close to a hundred and two twenty four bits so 24-bit would seem to be the optimum best situation for audio playback now I'm not talking about studio stuff here if you're doing things in the studio there is a good argument for using 32 bits because sound waves need to be manipulated they need to be added they need to be changed need to be mixed around and you need a lot of bandwidth so there's no clipping going on I'm talking now about playback 24 bit playback really is the best that we can expect now the problem with a PCM format this RAW format of always data with capture those are registering the sound wave is it can produce very large files for example a 16-bit capture of four minutes of music at 16 bits 44.1 kilohertz will produce a file size of around 40 megabytes now key that's not good for streaming services it's not good when you're streaming data over 3G or 4G so there has to be a way of generating smaller files and that's where we get into the different file formats that are available today now there are two different types of file format one is called lossless which means there is no loss of any of that data that was used to record the sound originally and the other is lossy which means that there has been some quality lost during the production of the sound file now the wave dot wav files you might find on PCs it's really a raw PCM format and that is lost less there's nothing lost in that there's also this very popular codec called flak and that also is lossless now flak has advantage that why it doesn't lose any of the data in the file it does use compression which means it can shrink down file size to roughly a half however that's still pretty big so then we move on to the lossy formats now the way these work for example MPs is a classic example of a lossy format is there are algorithms that are used trying to understand how the brain works trying to understand how the ear interprets these sounds and chops out bits that they reckon can't be heard now of course those that are very sensitive about music will say but you can hear it there is a big difference and I'm not going to get into that argument but the idea of a loss lossy compression algorithm is it doesn't just strip away randomly things it tries to strip away things that are not needed and then it also uses compression on top of that to reduce the file size so for example four minutes of wife might be 40 megabytes but four minutes of an mp3 at 320 kilobits per second might only be nine megabytes of ten megabytes so that's really like a quarter of the size and that's why mp3 is soap-opera today because we can have relatively high quality music near CD quality music that is actually a lot smaller which is great for streaming and great for storing on our devices now there are other lost lossy formats other than just mp3 there's also org forbus which is an open source codec and there's also the advanced audio codec AAC and AAC Plus which is used more predominantly by Apple and within iTunes and so on however Android can play AAC files that don't have any DRM now the advantage of AAC is at a lower bitrate it certainly has a greater audio quality than mp3 files a higher bit rates there are arguments between people about which one's actually best probably AAC comes out on top however at higher bit rates they certainly are comparable with each other so let's just sum up audio is recorded by measuring the amplitude of a wave at a certain time interval and we measure that roughly nowadays forty-four thousand times a second or forty-eight thousand times a second the measure the gradient is used to measure that is 16-bit is 65,000 different level 24-bit sixteen million different levels and that produces the accuracy of which we're registering something that come from the analog world into a digital represent now when that gets into your phone and you want to turn it back into analog again it goes through a DAC and the DAC converts that data back into a sound wave and it's got lots of clever technology inside of it that does things like smoothing and shaping that actually makes the sound that comes out as close as possible to the original and there are different quality Dax and different quality phones have different Dax in them and they are able to produce different qualities of sound and that's basically based on the cost of the DAC inside of that phone and finally there are different formats now we have an old saying in software engineering that if you put rubbish in you're gonna get rubbish out so if you start with a rubbish audio file doesn't matter how good your audio equipment is you can get rubbish out the other end but if you start with a good source then there's a chance you're gonna get good output now there are lossless and lossy codecs lossless include flak and wave wave files lossy include mp3 ogg vorbis and a a C and a AC plus each have their own characteristics but the amount of compression they can do the amount of data that's stripped out of them and the final file size well my name is Gary sim from Andrew authority I hope you enjoyed this introduction to audio and as I've said on other of my videos this only is an introduction it can't be more than that in just a few minutes or video but I do hope you liked it if you did please do give it a thumbs up also don't forget to subscribe to Android Authority you can follow me on Twitter you can follow handle authority on Twitter Google+ and on Instagram don't forget to download the Android app but last but not least don't forget to go to and/or Authority calm because we are your source for all things Android
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.