Analog and Digital
father
Before we talk about sound encoding, let me explain the difference between analog and digital using a clock as an example. An analog clock directly represents the passage of time with the continuous rotation of its hands, while a digital clock displays time using "numbers." With an analog clock, because the hands move continuously, you can determine the time between minutes to some extent by reading the position of the hands, but with a digital clock, you can't get any more detailed information than the displayed value. If it displays down to the second, you can instantly know the exact time, but even within that one second, there are infinitely many moments, and it's impossible to represent all of them numerically. In order to represent a continuous phenomenon digitally, there is a series of steps involved: dividing it into intervals (sampling), obtaining a value for each divided part (quantization), and then displaying it (encoding).
Otokun
Hmm. We use the word "digital" a lot, but it refers to a value that is a snapshot of a continuous phenomenon, right? So, digitally recording music means sampling, quantizing, and encoding the way the sound changes continuously, right?
father
That's right, when it comes to analog and digital in music, comparing records and CDs is a good way to understand it. Records and cassette tapes record sound as waveforms. Records are fundamentally the same in principle as Edison's invention of engraving waves the same shape as sound waves into grooves on a wax cylinder and extracting the sound with a needle. CDs, on the other hand, record sound in a completely different way. The sampling interval we talked about with the clock earlier is about 23 microseconds, or in other words, 44,100 times per second. This sampling interval determines the upper limit of the pitch of the sound when it is played back, and signals that include frequencies up to X Hertz can be sampled at a fineness of at least twice that (2X).
Otokun
Dad told me before that the upper limit of what a human can hear is 20,000 Hz, right? So, does that mean that CDs contain all the sounds that humans can hear?
father
That's right, one record contains all the sounds because it hasn't been sampled.
Otokun
But usually, people say CDs have better sound quality. Why is that?
father
The secret lies in quantization, that is, the process of quantifying sampled sound. Let's draw a picture. Suppose the original sound waveform looks like this (Figure 1). This is an analog waveform because it's continuous. We sample this at 441,000 Hz (44,100 times per second) (Figure 2). Then we quantize it (Figure 3). The width of the waveform during this quantization is represented by an integer between -32768 (-2 to the power of 15) and 32767 (2 to the power of 15 - 1). You've probably seen 16 bits or 24 bits written as dynamic range in the specifications of audio equipment. A bit is a representation of the number of digits in binary, so in the case of a CD, since it has a width of 2 to the power of 16, it's 16 bits.

Otokun
And what does that have to do with the idea that CDs sound better than records?
father
Regardless of whether the sound quality is good or not, CDs likely have less noise. The dynamic range of 16 bits is 96 decibels, which is slightly narrower than the range of sound intensity that human hearing can handle, but generally speaking, considering the sound being reproduced and the ambient noise, it's usually a sufficient range, and you could even say that the noise is at a level where it's inaudible.
Otokun
I've never actually heard a record play directly, but I have heard the sound of a record being played on TV. There was a static noise in it, and I guess that's the difference between CDs and records.
father
That's right, records are great when they're new, but if they have even a slight scratch, you get a crackling noise. CDs don't have that problem, and it's convenient because you can easily skip tracks. But even now, there are still many so-called analog enthusiasts who like the act of dropping the needle onto a record and the nostalgic noise in the sound, and they say that records sound better than CDs. The quality of sound is largely a matter of personal preference, so you can't simply measure it by frequency or level.