Basics of digital audio II

This article is a continuation of the previous Digital Sound Basics and it is recommended that you read it before proceeding.

In the previous article we saw how a sound wave is stored as binary numbers or digital sound. But how much space do I need to store a song?

Storage space

As we have seen, the most important thing is the size of each sample (how many bits are used in each sample) and the number of samples that are taken. The higher these two amounts are, the more space is needed.



If we take CD quality as a reference, we have that each sample needs 16 bits (16b) or, which is the same, 2 bytes (2B). 

In one second of sound, 44.100 samples are taken, so we will need 88.200 bytes to store a second of audio at this quality. 

Most CDs were 74 minutes long, which is 88.200 bytes × 60 seconds / minute × 74 minutes = 391,608 million bytes, or 391,6 MB (373,5 MiB). 

But let's not forget a little detail… the music on a CD is stereo. This means that we have two sound waves, one for the left and one for the right, which are not the same (if they were the same they would be mono). So we need the double, 783,2 MB (746,9 MiB). And this was the normal size of a CD.

But let's think, this was scandalous for the time (late 70's and early 80's). To get no idea, the original Macintosh had a disc capacity of 400 kB, which is enough to store just over 2 seconds of CD-quality audio. 

3,5 "floppy disks were capable of storing 1,4 MB (about 8 seconds) and continued to be used until the early 2000s. The hard disks of the 90s could not store the contents of a CD or maybe it was just at the beginning. for being a model that surpassed it, but at a prohibitive price to store music. 



Compressed sound

The solution was to reduce the required storage space, so that with fewer bytes we could store the same amount of music.

Thus was born the popular format audio MP3, which became very popular in the late 90s and early 2000s. Sound was usually stored using 64 kb / s (on an audio CD it was 705.6 kb / s) for one audio channel, 128 kb / s. s for stereo (on a 1.411 kb / s audio CD). This is a 9x reduction in space required. 

This is what it is known as compression with perdita (with loss in English). It is based on the fact that some of the information of the original wave can be lost because this loss is unlikely to have an impact on the listener, that is, they will hardly notice. So the space required (and the bandwidth to transmit) was reduced at the cost of losing some quality. 

At the beginning of the 2000s the format was born AAC (Advanced Audio Coding), which is an international standard format ISO / IEC 13818-7. Its efficiency is much higher than that of MP3, as well as using a variable bit rate (VBR) which allows it to adapt to every moment of the song and to use more or less bits to encode it. This means that half of the information must be used for the same quality. 

This is the format that Apple has chosen for its iPods, although being a standard you can find it as the default format for many devices, such as Nintendo, PlayStation, XBox, etc ... Also, it supports up to 48 audio channels, so it is also a standard for MP4 video files (movies, documentaries…) where it supports the typical Dolby 5.1 or 7.1 audio for movies without any problems. 



At the beginning of the iTunes music store, AAC files encoded at 64 kb / s per channel, i.e. 128 kb / s, began to be sold. Subsequently, in the early 2010s, it went to 128 kb / s per channel (256 kb / s in stereo). 

Therefore, lossy compressed sound can lose some of the information in exchange for a significant space saving (for both storage and transmission). Is the lossy compressed music of lower quality than the original file? Obviously, the question is, at what point are we no longer able to tell the difference.

Lossless sound

Uncompressed sound translates the samples taken from the wave as they are, as in the case of audio CDs, without loss from the moment it was digitized. 

Lossless compressed audio formats have also been released, i.e. they allow compression so that the file takes up less but the information contained is not at all altered (as if it were a .zip file) although the compression they get is much lower than that with loss compression , we are talking about compressing the original in half. In this case we have formats such as ALAC (Apple Lossless Audio Codec) from Apple itself or FLAC (Free Lossless Audio Codec) by Xiph.org, although there are more. 

Today we have discs capable of storing much more information than 20 years ago, much faster connections, so using lossless audio formats no longer has such a high cost to the user. 

The audio file is not the only important thing

We focused on how we store data and how it reaches our player. But our ears don't understand digital 1s and 0s. To hear the audio we have to convert it back to analog (DAC) and bring it to our ears.



Therefore, the digital-to-analog conversion device plays an important role. If you soften the wave, eliminate distortion, etc… it will generate a much better, much higher quality analog wave. Also, the cable that travels to our headphones or speakers, if it is shielded to reduce interference (remember that once in the analog world, we are fully exposed) and most importantly, the quality of the speakers themselves. 

We can have an original audio file, both analog and digital, of very good quality, but which is unable to travel and be reproduced faithfully through the speakers, so the quality with which it reaches our ears will be much worse. 

Therefore, the device of the player is paramount and, above all, the speakers, more than if the music arrives in analog or digital format, without data loss or lossy compression. There is no point in putting more data into a file if the audio playback system cannot reproduce it faithfully. 

What is the correct audio quality?

As we have seen with the screens, the increase in resolution made the image better, more faithful to reality. But there comes a point where you no longer notice resolution, we can increase it and the image quality will increase, but it won't help. 

At first, small increases in quality (resolution or sample rate) make a big difference in the listener's perception, but as it increases, each time, the difference in perception is smaller. Also, keep in mind that many audio equipment does not have sufficient quality to transfer that file as it is to the human being. 

In AAC audio files, going from 128 kb / s to 256 kb / s is already difficult for many people to distinguish, either by their sensitivity and / or habit, or by the equipment they use to reproduce. And keep going up from here and go for uncompressed sound, either a higher sample rate or a higher resolution is something that will increase file size a lot but that few people, and only with good equipment, will notice. 

Basics of digital audio II

Even if we already know the power of marketing. I remember, when I was little, how amazed buyers of brand new stereo TVs with this feature were when the TV broadcast was in mono.

I encourage you to try, experiment, from a file of the highest possible quality or from a CD. Try compressing it with different qualities and then, without knowing which is which, listen to see if you can notice the differences. That quality from which you no longer notice anything, is the right one for you. 

add a comment of Basics of digital audio II
Comment sent successfully! We will review it in the next few hours.