Sound exists in the physical world as changes in air pressure. A vibrating object creates these pressure changes, which travel through the air.
```text
Physical vibration
↓
Air pressure changes
↓
Sound wave
↓
Eardrum
↓
Hearing
```
The physical sound wave is continuous. But computers work with digital data. A computer needs sound to be represented using numbers.
```
Physical Sound
↓
Analog Signal
↓
Measurements
↓
Numbers
↓
Digital Audio
```
So the central question is:
How can a continuous sound wave be represented using discrete numbers?
# Continuous Sound
A continuous signal changes continuously over time. For example, a simplified sound waveform might look like:
Amplitude
↑
|
| /\
| / \
| / \
---|-----/------\------→ Time
| / \
| / \
The important idea is that the waveform exists continuously. There is a value at every moment in time.
Conceptually:
Time
────────────────────────────→
There are no gaps between one point and another. Physical sound is continuous.
# Sound as an Analog Signal
Before sound enters a computer, it can be represented as an analog electrical signal. A microphone converts changes in air pressure into changes in electrical voltage.
```
Sound
↓
Microphone
↓
Electrical signal
↓
Analog waveform
```
The electrical signal follows the changing sound. At this stage, the signal is still continuous.
```
Sound
↓
Continuous physical waveform
↓
Continuous analog electrical signal
```
# From Continuous to Discrete
A computer cannot normally store the continuous waveform directly. Instead, it takes measurements of the waveform.
Continuous waveform
/\
/ \
/ \
----/------\---------
/ \
/ \
Measurements
•
•
•
----•------•---------
• •
Each measurement gives us a value for the amplitude.
```
For example:
0.12
0.25
0.41
0.52
0.48
0.31
0.10
-0.15
...
```
These numbers represent the amplitude of the sound at particular moments in time. This is the basic idea behind digital audio. Digital audio represents a sound waveform using numerical measurements.
# Continuous vs. Discrete
| Characteristic | Continuous | Discrete |
|---|---|---|
| **Time** | Continuous | Specific measurement points |
| **Amplitude** | Continuous range | Numerical values |
| **Representation** | Waveform | Samples / numbers |
| **Example** | Analog signal | Digital audio |
| **Computer processing** | Analog circuits | Numerical processing |
A simple way to remember the difference:
**CONTINUOUS**
: The signal exists continuously.
**DISCRETE**
: The signal is represented at specific points.
# From Sound to Digital Audio
A simplified recording system looks like this:
```
Sound
↓
Microphone
↓
Analog electrical signal
↓
A/D Converter
↓
Digital audio
↓
Numbers
↓
Computer
```
The important transition is:
```
CONTINUOUS
↓
Measurements
↓
DISCRETE
↓
Numbers
```
The device that performs the analog-to-digital conversion is called an:
**ADC** — Analog-to-Digital Converter
Conceptually:
```
Analog signal
↓
ADC
↓
Digital numbers
```
# Sampling
Now we arrive at an important question. When should the computer take those measurements? The process of measuring a signal at specific points in time is called Sampling.
For example:
Continuous waveform
/\
/ \
/ \
----/------\---------
/ \
/ \
Sampling points
•
•
•
----•------•---------
• •
The computer takes measurements at regular intervals. Each measurement becomes a sample.
```
Sample 1 → 0.12
Sample 2 → 0.25
Sample 3 → 0.41
Sample 4 → 0.52
Sample 5 → 0.48
...
```
So, a sample is a measurement of the signal at a particular point in time.
# Sample Rate
The number of samples taken per second is called the **sample rate**.
For example:
```
44.1 kHz
↓
44,100 samples per second
```
Another common sample rate is:
```
48 kHz
↓
48,000 samples per second
```
Conceptually:
```
Lower sample rate
• • • •
Higher sample rate
• • • • • • • • • •
```
A higher sample rate means that the system takes more measurements per second. **Sample rate** tells us how frequently the signal is measured.
By the way, what numerical value do we assign to each measurement? This leads to another important concept called **quantization**. Quantization assigns each sample a numerical value that represents the signal's **amplitude**, or its instantaneous level.
Conceptually:
```
Continuous sound
↓
Sampling
↓
Discrete time
↓
Quantization
↓
Discrete numerical values
```