 The last one when we skipped over we have analog data like my voice or music But we want to send it as digital signals And what we'll do in fact is and it's very common nowadays is instead of trying to send it as analog data The common technique is to convert that analog data into digital data digitize that data So we take our analog data Convert it to digital data zeros and ones and then transmit it as a digital signal If we have digital data, we know how to send digital signals We've had the tech techniques already and in fact if we convert the analog data Into digital data. We can also send it using analog signals using shift key So the approach here in this last one is how do we convert the analog data into digital data? and you Do that or you see it in in practice Probably every day because what your mobile phone does when you talk to it You've got analog data as input the phone converts that into a digital form into zeros and ones your voice and then that sent Across the phone network in fact using analog signals with a mobile phone a digital signals So we're going to focus on the conversion process analog to digital data How do we digitize the analog data? and the thing that does that or the process is called encoding and The opposite process is decoding. So the thing we that does this did Digitizing of the analog data. We call a codec in this course. We'll consider just one very basic technique called pulse code modulation But there are many other codecs Anyone know others other codecs? We'll go through PCM. What are some others? Does anyone listen to music before on a computer? right What format music is in and it's originally analog, but when we save it on our computer. What format do we use? WMV WMA Windows Media Audio mp3 Flak and many other Formats they involve specifying how to convert the analog data the music the audio and Convert it to bits So we can save it on our computer. That's all we're doing here, but PCM is the the very basic approach The ones that we mentioned mp3 and so on may may have some additional features So let's look at PCM And I'll briefly explain it, but then for the detail we'll go through an example The picture may not be so useful this stage. There are really Well four steps which will go through our example we have an analog data as input It covers a range of amplitudes an infinite number of amplitudes. It's analog mean it's continuously changing the amplitude What we do is we split The from the maximum to minimum into a discrete level of amplitudes We break it into a discrete number of levels That's the first step and each of those levels each of those amplitudes will assign a code number Like level zero level one level two level 255 we'll see that through an example then over time if you think of the Horizontal axis over time we take samples of the input analog data Every so often we record the actual input level from the first step find out what that level is and That level becomes a number It's got a special name in in in PCM a PAM value and once we have a number an integer We can represent that in binary And that's the last bit we get a n-bit binary number a code and that's our digital data so the key concept is we We're going to divide our amplitude into a discrete number of levels Then we're going to take discrete set of samples over time and each sampled value We'll correspond to one of the levels which will map to a binary number and that gives us our digital data So to illustrate that we'll go through an example Which is not in these lecture slides, but if you flick forward a few pages you'll find another handout on PCM Move forward on your handouts, and you'll find it this one. It's just a bit more detailed example of PCM pulse code modulation a very simple unrealistic example, but one we can follow through Everyone's found it So here's our Input analog data. This is what we want to send to our receiver and the way that we're going to send it is we're going to Digitize it. We're going to convert the analog data into digital data zeros and ones So it's just some made-up analog data over time. You can see the amplitude is varying Continuously changing So let's put some scale to that for this example There's an amplitude and the horizontal axis is time and I put some numbers on here so we can do some calculations We say that this scale just for this short period of time The analog data may keep going, but for this example goes up to about 18 milliseconds So this is think of it someone talking for 18 milliseconds We want to take that Audio and convert it to zeros and ones. How do we do it with PCM? The first thing we do is we divide the amplitude Into a discrete number of levels Usually the same width the same height The same height in terms of amplitude and in this example for the first case I chose eight levels So we've got eight levels, so I'm going to label them zero to seven so the the way to interpret this picture now is that From the bottom solid line to the first dashed line corresponds to level zero and Above the top dashed line Corresponds to level seven, so we have eight levels here and in this case We're going to set a sampling interval of four milliseconds That means every four milliseconds. I'm going to record a sample of the input analog data Let's do that We'll start at time zero So you think what I do I have this input data. I record at time zero What is the actual level and we measure this value whatever it is? Maybe it's one point one three four volts and I map it to the one of the discrete levels that I have Defined and at the start so in this case the way to read it instead of trying to me tell you what the actual Voltage or the signal strength is We just realized that at this point the signal is in level one If it fell in this range, it would be level zero up here level two But in this case it falls in the range for level one So the level What we sometimes call the code number is one and now let's convert that to binary So we have decimal integers for the levels. Let's convert it to binary and because we have eight levels Let's convert it to a three-bit number 001 so one in Decimal 001 in binary why three bits? Well, if we're going to have eight levels We need three bits to represent any of those eight numbers from the zero to seven Think of this as simply zero zero zero up to one one one. We could use four bits But it would be a waste To represent eight numbers, we don't need four bits We only need three bits and it turns out we'll see shortly. We want to use as few bits as possible Two is not enough of course. We can only represent four numbers with two bits That's why I get a three-bit Value here. This is the sampled value and Then with a sampling interval of four milliseconds at time four we do it again. I At this point in time. I measure what the value is here The actual value and I see it falls within the range of level six So we convert that to a three-bit number and we get one one zero six and we keep doing that and We get another three samples and We get a sequence of 15 bits. This is our digitized analog data So we've converted our analog data the blue line Into 15 bits in this case into our digital data and Those bits would be sent to the receiver or if it's Say for music and you want to save it on your computer. It may be saved on the hard drive Any questions on how PCM works at this stage? Discrete number of levels the number needs to be defined in this example. I chose eight levels and a Sampling interval in this case. I chose a four millisecond sampling interval. We take Measurements of the input analog data at each sample point and That corresponds to one of those eight levels and we get a three-bit binary number for each sample then We send those bits to the receiver Using whichever technique we want to we have digital data. We can use digital signals or analog signals Let's look at what the receiver does The receiver receives these 15 bits. You can think it receives three bits at a time at time zero the transmitter Generated zero zero one and then sends it to the receiver The receiver receives zero zero one Then it will shortly later at four milliseconds receive one one zero zero one one and so on What does the receiver do? the receiver is going to receive those bits and Then try to generate that same data the analog data and this is what it generates think when the receiver receives the first three bits at Relative to it from the receiver's perspective at time zero received zero zero one or level one so what it does is produces an analog output at level one For four milliseconds because our sampling interval is four milliseconds. It holds that level for a fixed duration Then at time four the receiver receives another three bits one zero Level six, so it produces an output at level six Then at three one and two didn't finish the picture here So this is the analog output at the receiver It's as you see an approximation of the input at the transmitter What it will call the reproduced data at the destination or the receiver? So let's compare them The blue line is the analog input The green line is the analog output One example may be the blue line is your voice when you're talking on your mobile phone and The green line is produced by the speaker at the at your friend's mobile phone That is the speaker on the phone at the receiver as it receives the bits it produces some analog output But it's not continuous because all that was it receives is these Bits every four milliseconds. So all it does is holds the level for a period of time Of course, they're not the same But you may see that the green line is sort of following the blue line It's low at the start it goes up to a peak and then slowly comes down a bit and then goes up a bit at the end What we care about is how close that green line is to the blue one We can think that's a measure of quality of the the analog output in terms of audio How good it sounds? We would like to get as close as possible to the original input When we reproduce it at the receiver How can we get closer? I want to get the received Analog output the green line closer to the blue one. What can we do? Right so we've got two options we can change the number of levels that we have here here We chose eight and or we can change how often we sample the other two parameters of our Our codec in this case PCM. I said in our case. It was four milliseconds and eight levels Let's go through three other cases with different values And we'll plot them and you'll hopefully visually see the difference between them. So let's do case two still with eight levels But now we use a two millisecond sampling interval Every two milliseconds we take a sample convert it to a three-bit number It's three bits because we still have eight levels We get twice as many samples half the sampling interval We transmit those 30 or so bits to the receiver When the receiver receives those bits every two milliseconds it produces an output at the the designated level So zero zero one for two milliseconds then at three for two milliseconds and then at four six and so on And this is what we get for two milliseconds we hold the level at one Then at three for two milliseconds then at six for two plus another two because there are two sequences of six received Then at three and so on What we will do at the end is I'll compare the different cases So this is comparing that for case two the input data and the output data Maybe you can see it's a little bit closer to the blue line But let's go through two more cases and then I'll show all of them overlapping on each other We can change the number of levels Here I use a two millisecond sampling interval every two milliseconds take a sample But use 16 levels zero to 15 and With 16 levels every sample must map to a four-bit number Because we need four bits to represent any of those 16 values from zero zero zero zero up to four ones for 15 So every two milliseconds we generate four bits and Those bits indicate the level We transmit those bits to the receiver and the receiver will generate hold for two milliseconds the output at that particular level and becomes this It's hard to compare with the other one. We'll do it shortly one last case One millisecond sampling interval 16 levels, so we've just reduced the sampling interval even further. We have four bits per sample But now every one millisecond we record a sample So many bits are transmitted this is what we Get at the receiver when we reproduce that Analog data, and I'll Try and show all four at once plus the input analog data It's not easy to see because some of them overlap and I haven't You can't see some are behind others, but first the blue line is the input That's what we want But what we're doing by taking discrete number of levels and discrete samples is we're approximating that and the red line and You don't see much but because it's actually behind I think the the orange line in many cases, so when you don't see the red line at this orange Line behind it because they're the same the red line was case one four millisecond sampling interval eight levels If you compare the red line with the others, I think you'll see that it's further away from the blue one especially at this point It's a long way away from the blue one But the others are much closer at that point and similar at this point It's not so accurate compared to the others the others follow the blue one a little bit closer So I may conclude that the red one is the least accurate representation of the input analog data in this case case one Case two and case three. It's hard to tell the difference. There's not much difference between them In fact again a lot of overlap. All right the green and the orange ones differ a little bit here The orange ones may be a bit closer, but at different points. They differ but here they're overlapping in Fact visually it's hard to tell the difference between case two and three But maybe you'll see the purple one case four is Again a little bit closer to the blue one compared to the first three For example at this point The red one is actually below these two case one two and three come down here The blue line is here. The purple one is the closest Now this is just approximating But if I hope you can see that the case four is the better approximation of the blue line Compared to the first three cases It's a more accurate reproduction of the original data It will depend upon what is the input as to how close they get but in general what we can Observe or what we'll discover is that the more levels you use and The more sampling or the more samples you take The more accurate you'll get in reproducing the original input So if we went up to 32 levels and we sampled every half a millisecond We'd get even closer to the blue line 64 levels sample every 0.1 milliseconds Then we'd be even more accurate. We use a million different levels and We sample every nanosecond Then the reproduced data will be very very very close to the blue one. You may not be able to see the difference In fact the blue one is just when we have an infinite number of levels and an infinite number of sample points That's what we get for a continuous line so More samples or smaller smaller sampling interval More samples in the same time and more levels gives better accuracy What's the problem? the more samples and the more levels The more bits we need to send to represent that same input analog data In all cases, it's the same data. Let's say it's the voice. It's the same voice that we're reproducing But as we increase the number of samples and increase the number of levels We need to transmit more bits to represent that same Analog data and that's the negative or disadvantage The the previous slides have some calculations, but they're summarized Actually, we'll jump back just to see the calculation Case one at least For case one We sampled every four milliseconds With eight levels we've reproduced three bits per sample So we get Three bits per four milliseconds every four milliseconds. There'll be three bits to be transmitted That equates to 750 bits per second So with case one to represent our data, we need to transmit 750 bits per second Case two we sampled every two milliseconds We still had three bits per sample. So if we sample twice as often Then we'd need to send it twice the speed 1500 bits per second and One of the later slides summarized the values of how much we need to send that and we'll use that to explain the trade-off In case one We need to send it 750 bits per second to transmit our analog data in case two we went up to Will we we halved the sampling interval from four down to two so we double the number of bits per second needed case three we had four bits per sample So equates to two thousand bits per second in case four we halved the sampling interval again to get four thousand bits per second Lower is better here. This is what many people get confused about This is not data rate of a link This is what I'll call to send the data. This is the data rate we require To deliver that data You can think about it if I have a link I've paid for a link and the data rate of that link is 3000 bits per second Then if I use the sampling interval the number of levels of case one then of that 3000 I would use 750 and the rest will be available for use for other users But if I use case two of the 3000 I would use 1500 bits per second I would require that amount to send my same analog data Okay, three two thousand bits per second. I couldn't do case four if my link supports three thousand bits per second But I must send it four thousand bits per second. I cannot do it My capacity is less than what I require so the point here is that This is not data rate of a link. This is the data rate we require to send this data So we would like to require as small as possible because it's still the same data Case one is best when we compare the data rate required case four is the worst but Case four was the best in terms of reproducing the analog data accurately We say in the accuracy or the quality of the reproduction case four is the best Case one is the worst We can see that visually here. There's more Accurate ways to measure that and that represents our trade-off with sampling and PCM more more samples more levels better accuracy But the more you must transmit the higher the data rate required and that's the negative To send analog data as digital signals or even analog signals one common approach We use is we digitize that analog data convert it to digital data and then send that and we Previously looked at using pulse code modulation PCM to do that conversion. So let's just Recap on what we know about PCM We went through an example in this example on this slide we have our Input analog data the solid line and with PCM. It's very simple our regular intervals record a sample That is measure the level the magnitude of or the amplitude of the input analog data Find out the actual value and Then map it to discrete value Which we call one of the levels in this picture shown the levels are shown as code numbers So in this case there are 16 levels from 0 to 15 but record at each sample point the Amplitude of the input analog data map it to one of our predefined levels and Those levels are then mapped to a binary value With for example 16 levels we need four bits per level to represent one of the number from 0 to 15 and We do that every sample point and we get our digital data and that's our representation of our analog data and the two main trade-offs that we care about with PCM and other techniques like this is When we send that digital data to somewhere or Maybe we save it on disk and then need to reproduce the analog output How good is that reproduction? What's the quality or accuracy in which this digital data can be used to reproduce the analog? input and we saw through examples in the previous lecture that When we reproduced a simple way we can look at it is that we produce a a step type wave we step up depending upon on the level and To get an analog output Which is as close as possible or closer to the analog input The two things we can do do to increase the accuracy We can have more samples Take more samples means we get more granularity on the horizontal axis and We could have more levels we get more granularity on the the vertical axis So more levels and more samples will allow us to get an analog output closer to the original input So that's another way to think of that the more samples the more levels the higher the quality of the reproduction But the trade-off here is that the more samples the more levels the more bits that we will get for the same amount of input and The more bits we need to represent that analog input that That is a disadvantage because we either need to send more bits across a link or From saving this on my hard disk. I need to use more space to save it So we'd like to use as few bits as possible to represent this data Few samples few levels to use less bits But more samples more levels to get better quality and that's the trade-off that we need to deal with is Summary that gives us an appropriate number of bits for the quality that we want to achieve We'll go through one more example of this some practical example, but before that so we need we need a Sampling interval that's going to be appropriate and the number of levels it depends on the analog input Maybe voice requires different than music and requires different from our other analog inputs For the sampling interval we often talk about the sampling rate. How many samples per second? so If the sampling interval is one millisecond Every one millisecond we take a sample then we say the sampling rate is one thousand samples per second Or we say one thousand Hertz one thousand times per second Now, what is a good sampling rate? for the moment forgetting about the number of levels or Assuming we have an infinite number of levels. What is a good sampling rate? Well There's a theorem that tells us what the optimal sampling rate should be It says if our input analog signal here. It's a noted f of t but our input analog data Remember any analog signal can be represented as a set of summation of sine waves and Each of those have a frequency so our input analog data has a Set of components from some lowest frequency component up to some highest frequency component so The signaling of the sampling theorem tells us if we sample at a rate Higher than twice the highest signal frequency of their input analog data Then when we reproduce we can get a perfect reproduction of the input analog analog data What does that mean? Let's take voice as an example Voice is the input analog data the human voice Ranges in frequencies from a bit larger than zero Hertz up to about four thousand Hertz so the maximum Frequency component is let's say four thousand Hertz. No one speaks with a frequency higher than four thousand Hertz So the highest signal frequency of our input is four thousand Hertz The sampling theorem tells us if we sample at a rate two times that at 8,000 samples per second then if we had an infinite number of levels and we reproduce From the sample data that analog output will get a perfect reproduction So it gives us a guide of what the sampling rate should be another way to think of that if my voice Goes up to four thousand Hertz if we sample at eight thousand times per second We will get good reproduction good quality at the output if we sample at ten thousand times per second We will not improve Eight thousand is enough That's another way to use the sampling theorem twice the maximum frequency component is sufficient To accurately decode and get the original data back Ten thousand is no better than eight thousand samples per second 100,000 samples per second very short sampling interval does not improve compared to eight thousand samples per second It depends upon the maximum frequency component Six thousand samples per second is worse than eight thousand samples per second We should try to get up to two times the maximum frequency component less and there'll be a Degradation in quality in the reproduction So if we have music for example, what's the range or the maximum frequency component of music? Music has a wider range of frequencies than the human voice What's the maximum frequency component? It's probably somewhere in your lecture notes Maybe the one of the very first lectures anyone remember You listen to music an orchestra or a band or something what freak? What's the highest frequencies that music will typically produce? I think in one of our first lectures We had a plot of analog data and digital data and music typically ranges up to about 20 kilohertz 20,000 Hertz So different instruments can have very high frequencies compared to the human voice So music let's say the maximum frequency component is 20,000 Hertz That tells us if we want to record music and save it in a digital form We should sample at two times that rate at 40,000 Hertz That's what the sampling theorem tells us if music goes up to 20,000 Hertz sampling at 40,000 Hertz is sufficient to to get Accurate reproduction less than 40,000 will produce lower quality reproduction More than 40,000 will not change the quality 40,000 should be sufficient So it depends upon the input analog data as to what sampling rate we should use We don't have to use that sampling rate, but it's just giving us what what we could use to get the optimal quality This actually assumes we have an infinite number of levels which we don't In practice we have a finite number of levels. So what's a good number of levels to have again? It depends upon the input with voice When people have done experiments especially for phones not necessary mobile phones, but home landline phones Then to get good quality voice reproduction The suggestion is that you have 128 levels So instead of zero to seven or zero to fifteen you have zero to one hundred and twenty seven And when you sample you map to one of those one hundred and twenty eight levels With 128 levels it means seven bits per level So a recommended value for for sampling voice to get good quality reproduction is you sample at 8,000 times per second because human voice doesn't go above 4,000 Hertz and we sample it twice that and We have seven bits per sample or 128 possible levels Sometimes we'll extend that to eight bits per per sample eight bits is a nice number because it's the same as a byte so often we'll see voice we talk about eight bits per sample and 256 levels still 8,000 samples per second eight bits per sample at 8,000 samples per second eight times 8,000 is 64,000 bits per second Good quality voice streamed across the network using PCM You need to send it a speed of about 64,000 bits per second 64 kilobits per second If you want to get music in there as well, then you need to consider that music has a higher range of frequencies than voice So for example if you wanted to stream a Radio station across the internet and There was only talking it was a talk back radio station. No music played very boring But still only talking then if PCM was used to encode then to get very good reproduction You could stream at 64 kilobits per second Because that allows us to take the input voice Sampler 8,000 times per second eight bits per sample all right We could use seven bits, but it doesn't change much eight bits per sample It's the one byte and that's equivalent to 64,000 bits per second and send that the receiver that receives it When you receive that stream at 64 kilobits per second Your computer converts it back to analog output and plays it on your speakers and It should be good quality because we've sampled at sufficient rate and the sufficient number of levels That's if you use PCM There are other codecs not just PCM that will allow effectively to compress that information Reduce the size but give almost the same quality So you don't have to go up to 64 kilobits per second even one last example I'll bring up a recording of voice again I'll open some recorded voice in a sound editor and we can see the the audio So this is five minutes of recorded voice in this case audio and it's just the showing that input and or that analog data in The time domain so from zero up to five minutes here And we see the variations of the amplitude over time What this in fact is is the software has is taking the digital representation of this audio the zeros and ones and Creating this plot to show us what the analog output would look like This is just me loading up a file on my computer. So it's the digital form of the voice, but viewed From what it would look like in terms of analog reproduction if we zoom in on some parts We keep zooming in a bit. We see it. This is our analog data It's that looks like a signal It's effectively if we break it down a summation of sine waves of different amplitude phase and frequencies It's more complex than the ones that we've seen, but you can see some variations There we keep zooming in In fact, what the software does is that it takes the digital representation of this audio Which is the set of samples if we keep zooming in we'll start to see in fact There's just a set of sample points the dots So I've zoomed right in each dot represents one sample this Analog data was sampled using PCM pulse code modulation and At a rate such that if you look at the time scale Each dot here is a particular sample some binary value which tells us the the level on the vertical axis and The time on the horizontal axis and then there is the next sample and the next sample and so on So you could actually map them back to the binary values What the software does to make it look nice is joins the dots So it looks like a solid line, but actually it's just sample points that's saved in the file The software just joins them together. How big is the file when I save it? So here's five minutes of audio How big is the file when I save it on disk? Anyone want to calculate or estimate? guess To start how do how big do you think it's going to be when I save it on this five minutes of of me talking? 500 gigabytes 500 kilobytes that sounds a bit better 500 gigabytes my disk is not that big okay 500 kilobytes Anyone else? It's not a bad guess anyone else 3 megabytes 5 minutes 3 megabytes Yep 200 megabytes okay, so we have three values 500 kilobytes 3 megabytes 200 megabytes We can calculate it. It's using PCM, but we need to know two things We need to know the sampling rate that was used So this is a recording for when I talk the analog input the computer is sampled at a certain rate and each sampled Sample was mapped to one of so many levels, so we need to know how many levels and I Forgot to set it, but I think I Checked before in the format It's actually 16-bit PCM And it's hard for you to see but the sampling rate is 44,100 Hertz That's the sampling rate every second there are 44,100 samples and Every sample is mapped to a 16-bit number So the number of levels is 2 to the power of 16 65,000 levels in our vertical axis and 44,100 samples per second in the horizontal axis Now find the file size Calculate how big the file is so we have a Write down the information you can calculate. We have five minutes of audio we're using PCM and The sampling rate 44,100 Hertz so when I recorded the audio that the software was set to sample at that rate and Each sample was 16 bits long. How big is the file when I save it on disk? How are you going to calculate? very easy 44,100 samples per second Each sample is 16 bits so then how many bits per second? 44,100 times 16 bits per second are Recorded on disk how many seconds? 300 seconds five minutes times 60 300 seconds just multiply and we'll get the file size in number of bits We sample 44,000 times per second 44,100 Hertz Every sample is 16 bits long. So that's the number of bits per second How many seconds well we have five minutes? 60 seconds per minute Problems with my keyboard Start again That's the number of bits for five minutes of audio and now let's convert the bytes Divide by eight because file sizes will see recorded in bytes 26 megabytes who was closest all right not many people someone said three megabytes someone said two hundred megabytes Well, maybe somewhere in the middle 26 megabytes is the file size 26.46 26,460,000 bytes to save that audio 26 megabytes about Let's confirm. I've saved the file on disk. Let's see the actual file size It's a the format of that file the codec was PCM the way that we save the data on disk We use the format referred to as wave the wave format. So the extension is Dot wave WAV Here's the file size in bytes 26,460,144 we were close we 144 bytes off Well, because the wave format adds a little bit at the front to tell us the exact structure of this file So it takes the 26 million bytes of actual audio Plus it adds 144 bytes at the front of the file to say this is a wave file using PCM encoded data 26 megabytes When you save an audio file what format do you use or what codec do you use? I think we said yesterday some of the different codecs instead of PCM. What could you use? How do you save music? What do you use? to save music mb3 anything else flak WMA and Many others. Okay, there are different codecs and all formats be careful. There is two different things The codec is how do we convert the analog to digital like PCM as a codec? mp3 specifies a codec But also there's how do you save that data on your disk or in a file? So there's also there's a format sometimes they are the same So mp3 has a codec and you'll see the extension mp3 here. We have a PCM as a codec the format is wave, but Often that's not the case Let's save that file or that that audio in different codecs It's actually saved as a wave file at the moment, but I can Export it to a different format first mp3 and then I'll do again to flak And then many other formats Okay for different systems or codecs If we open them those now I have three files dot wave dot mp3 dot flak If I open them up, they'll look basically the same and if you play them They'll probably sound about about the same. There may be some very subtle differences But I think in this case your ears will not pick them up very well, especially if we use this audio system But let's look at the file size The wave file was 26 megabytes. The mp3 is 4.8 megabytes Flak is 13 megabytes same original analog data Using different codecs to sample and to save in binary We get different file sizes. That is we need a different amount of data a number of bits to save that input analog data Wave is the biggest flak is then about half of that flak refers to lossless compression It really compresses the wave file because there are certain patterns in that PCM encoder data that can be replaced with smaller bits Smaller patterns of bits. That's what compression does really it looks for some patterns in the input instead of Saving that pattern that may repeat many times. It saves it with a smaller special code So we can have fewer bits to represent it So that provides compression in the same way that zip compresses your data files You take a text file. You use zip or ra or another compression Algorithm to compress when you decompress you get the exact same data back If we play back the flak and the wave the quality will be identical They'll have the exact same original sequence of bits. So the quality will be the same mp3 does a little bit different it compresses But it throws away some of the original data So when you play it back the quality in theory will be lower than the wave and flak files But in practice often the quality is hard to distinguish by our ears. It depends upon different parameters and the input So we make a trade-off between the quality of the playback Which one will be higher quality and the file size? We want small file size and high quality so there are different trade-offs to consider Similarly if you want to stream across the internet your audio the codec that's used Different codecs can produce higher quality, but will require more bits to be sent in the stream So that's why we want to keep the number a bit small so we don't consume so many resources It's not our intent to study the other codecs just an example there This software that or the software that I use to record the audio by default it uses PCM and it Uses 16 bits per sample and 44,100 Hertz 44,100 samples per second. Why does it use 44,100 samples per second? What's the significance of this number? We said with voice voice ranges frequencies up to about 4000 Hertz The sampling theorem tells us if you want to record voice you only need to sample at about 8,000 Hertz twice the highest frequency, but here we're recording at 44,000 Hertz Well, we said before music Music contains frequencies up to about 20,000 Hertz so the common standard is to sample just at Slightly above that and double So the the standard is 44,100 Hertz because assuming music contains frequencies less than 22,000 Hertz The sampling theorem tells us sample at double the highest frequency component So that's why we use by default 44,100 if you buy an audio CD How much music can you fit on an audio CD? Not one with mp3, but the original audio CDs. How many minutes of music can you fit? About about one hour Little bit more than 60 minutes. I think you can fit maybe 70 so minutes on a music audio CD How much data? How many megabytes can you fit on a CD? More than 500 about 700 megabytes 750 megabytes Okay, so a CD in terms of data has about 700 megabytes in terms of audio about 70 minutes The standard format for encoding audio on a CD It stores the indigital data, but the audio is analog. It uses PCM At 44,100 Hertz 16 bits per sample The only difference is the audio on a CD has two tracks It's stereo. There's a left and a right audio track so you can do the calculations and see that with about 70 minutes of music at 44,100 samples per second 16 bits per sample and Times by two because you have the left audio and the right audio Then that equates to about 700 megabytes if you want to save that on a disc So that's why an audio CD Fits about 70 minutes of music. You can calculate the exact number. It uses PCM But if you buy an audio CD that has MP3 encoders files, you'll get much more Many more minutes of music saved on that same amount of disk base Any questions to finish our topic on signal encoding techniques?