The Digitization Of Music - ECE-180D-WS-2023/Knowledge-Base-Wiki GitHub Wiki

Nathaniel Kim - Seungwoo Baek

Ece 180DA / DB

Mar. 24, 2023 - Jun. 9, 2023

The Digitization of Music

Introduction

As you take a stroll down the busy streets of any bustling city, one of the most common sights you'll come across to see is people wearing earbuds or headphones, lost in their own musical world. Step into a café or restaurant, and you'll be greeted by the rhythmic beats of the background music. Even when you go to the festive occasions, music becomes an inseparable part of the celebration. Undoubtedly, music has become an important part of modern society. But, have you ever wondered how exactly music gets recorded in a studio and then played back on our mobile devices? Sound playback technology dates back to Thomas Edison’s phonograph in 1877 (Brain 2000). This device used soundwaves to vibrate a diaphragm that moved a needle, physically etching the recording into tinfoil. This is what we could call an analog recording device, since the soundwave recording was a continuous representation of the soundwave. Another analog playback device is the record player, where a needle passes over the grooves of a disk which gets converted into an electrical signal and then amplified into sound. Nowadays, the vast majority of music we listen to is stored digitally, for example on Spotify or Apple Music. This allows us to have vast catalogs of music just a tap away on our smart devices. This begs the question, how is sound stored digitally and played back perfectly recreated?

Background

Fig1. Sound wave in time domain for the word “hello”, containing many frequencies (Brain 2000)

What exactly is sound? Sound is a physical wave that can contain many different frequencies. For a pure tone, we would expect to see just a single sine wave of that frequency. For speech, the wave would look more complex because the sound wave would consist of multiple frequency components. Since sound is an analog wave that computers cannot understand, an ADC (analog-to-digital converter) is used to record the sound. The most important parameter of this conversion process is the sampling rate. The sampling rate tells us how many times per second the analog signal is being sampled, or measured.

Fig2. Left side signal sampled at a low rate; right side signal sampled at a high rate (Brain 2000)

Using too low of a sampling rate would result in a poorly digitized sound wave that loses a lot of information from the original analog signal. As a result, the sound would not be able to be reconstructed accurately and played back. Sampling below the Nyquist Rate, twice the frequency bandwidth, would result in distortion called aliasing where signals cannot be distinguished. In general higher sampling rates are better to get the best recreation of the analog signal and the highest fidelity sound. Today audio is generally recorded at a sampling rate of 44.1kHz (TechGuru 2020). Music is recorded in a studio, and that recording is fed through an ADC so that it can be stored as digital information that a computer can read. In the figure below we can see that for two different file types, as the bitrate increases the score goes up. We can also see from this that for two different file types, you cannot simply compare their bitrates to determine if one is better than the other.

Fig3. Graph of bitrates and opinion score (guruboolez)

There is another reason for using a digital signal rather than analog, noise immunity. Reducing the noise in signal processing has been the key technique, which would prevent distortion of the information in the signals. Analog signals are transmitted in a continuous waveform and are susceptible to noise interference, which can cause distortion in the signal. This noise can come from a variety of sources, including electrical interference, radio frequency interference, or even physical factors such as temperature or humidity. Because analog signals are continuous, it can be challenging to detect and isolate noise that has been added during transmission. This is because the noise can blend in with the original signal and become indistinguishable from it. However, digital signals are less susceptible to noise during transmission since they are made up of a series of 1s and 0s. Because of this, the signal can be easily regenerated and corrected if any errors occur during transmission. Moreover, there are different coding schemes, including Pulse Code Modulation (PCM) or Differential Pulse Code Modulation (DPCM), which are typically used for error detection and correction techniques (Stallings). Pulse Code Modulation (PCM) is a technique that samples an analog signal at regular intervals and converts each sample into a binary code. The resulting binary codes, which represent the amplitude of the analog signal at each sample point, are then transmitted as a digital signal. Differential Pulse Code Modulation (DPCM) is a more advanced form of PCM that uses the difference between adjacent samples to encode the signal, rather than the absolute amplitude of each sample. In DPCM, the difference between the current sample and the previous sample is quantized and then encoded as a binary code. This reduces the amount of data that needs to be transmitted, compared to PCM, without sacrificing quality. DPCM is particularly useful for applications where bandwidth is limited or where transmission errors are likely to occur. With these techniques, the use of digital signals for audio processing offers various advantages over analog signals.

How to Get Good Sound Quality

Once that digital information is stored, how is it played back so that we can listen to the music as it originally sounded in the studio? That digital information has to be converted back into an analog signal, aka sound that we can hear. To do this a circuit called a DAC (digital-to-analog converter) is used. DACs can be found in your playback device, so your smartphones and laptops. There are several parameters that can set apart a good DAC from a great DAC, which is why many audiophiles prefer to use external DACs to get the best music playback possible. One parameter called SNR is one of the parameters that determine a good DAC. SNR is a measure of the ratio between the desired audio signal and the background noise introduced by the DAC. It indicates how much the audio signal stands out from the noise floor (Al-Janabi). A higher SNR value represents a cleaner and more accurate audio reproduction. It is usually measured in decibels (dB), and a higher SNR, such as 100 dB or more, is generally considered desirable, which can be achieved by applying an external power supply. Another parameter that limits dynamic range is bit depth. Bit depth refers to the amount of information in each sample, which limits the volume levels that notes can take on (Thomas 2022). A low bit depth would result in the notes not being able to be recreated how they were intended, with more notes being lost to noise. Higher bit depth is better, but generally after 16 bit a higher bit depth is unnecessary to the average listener. This is because at 16 bits, the dynamic range would be 96.33dB so sounds below that level would not be lost to noise. With a higher bit depth, however, comes the requirement for the DAC to convert more information at once, so it will need a high bit rate to keep up. The bit rate is how fast the music data is being decoded by the DAC (Thomas 2022). There are different types of files such as the MP3 which has 320kbps and the FLAC which has 1400+ kbps. The higher the bit rate the higher fidelity the sound, but the more space the file will take up in storage. Across all of these parameters, a middle ground is probably best for most listeners, so the MP3 would work just fine. Once the DAC has converted the digital signal back into an analog signal, the signal is amplified so that you can listen to your music through the speakers.

Conclusion

Engineering techniques are all around us, often hidden in plain sight, affecting our daily lives in ways we may not even realize. It's truly fascinating to understand the fundamental of these techniques. This essay introduced the digitization of music, which makes a good listening experience. It is a fact that you will need to have a good sampling rate for your music recording so that no information from the original signal is lost. Then it would be best to have a high bit depth with 16 bit being the typical value. If you are choosing space efficient compressed audio then you need to look for a high enough bitrate so that the sound’s fidelity is not diminished. While many still enjoy analog storage forms for listening to or collecting music, digitization has allowed us to have convenient access to music wherever we are. There are many ways to enjoy music these days, but we should remember that analog devices will always have the upper hand because they can capture the exact signal. The convenience of digitally stored music will never be able to capture of the exact signal, however through careful choice of parameters we can get the sound quality to be indiscernible from analog devices.

Bibliography

guruboolez. “Personal Blind Listening Test: AAC vs OPUS from 80 to 140 Kbps • PART I .” Personal Blind Listening Test: AAC vs OPUS from 80 to 140 Kbps • PART I, https://hydrogenaud.io/index.php/topic,120166.0.html.

Marshall Brain & Jonathan Strickland "How Analog and Digital Recording Works" 1 April 2000. HowStuffWorks.com. https://electronics.howstuffworks.com/analog-digital.htm 8 February 2023

TechGuru. “What Is Bitrate and How Does It Affect Audio Quality?” Nerd Techy, 20 Jan. 2022, https://nerdtechy.com/what-is-bitrate.

Thomas, Christian. “Do You Need A DAC?” SoundGuys, 30 Dec. 2022, https://www.soundguys.com/do-you-need-a-dac-13488/.

Stallings, William. “Data & Computer Communications (10th edition)” Pearson, 13 Sep. 2013. https://www.pearson.com/en-us/subject-catalog/p/data-and-computer-communications/P200000003353/9780137561704

Samaher Al-Janabi, Ihab AI-Janabi, Noora AI-Janabi. “Data Science for Genomics” Academic Press, 2023. https://www.sciencedirect.com/book/9780323983525/data-science-for-genomics