Sound Waves and Digital Audio Fundamentals
What you'll learn: How computers convert continuous sound waves into discrete numerical sequences that machine learning models can process.
The Physical to Digital Journey
Sound is a continuous, analog phenomenon—vibrations traveling through air as pressure waves. To work with audio in machine learning, we need to transform these smooth, continuous signals into digital data: sequences of numbers.
Think of it like turning a smooth curve into a dot-to-dot drawing. You can't store every infinitesimal point, so you sample the wave at regular intervals and record its amplitude (height) at each moment.
Sampling: Freezing Time
Sampling rate determines how many measurements we take per second. A CD-quality audio file samples 44,100 times per second (44.1 kHz). Each sample captures the air pressure level at that instant.
The Nyquist theorem tells us we must sample at least twice the highest frequency we want to capture. Since humans hear up to ~20 kHz, 44.1 kHz covers the full audible range.
Quantization: Discrete Levels
Each sampled amplitude value gets quantized—rounded to the nearest level in a fixed set of possibilities. With 16-bit audio, each sample becomes one of 65,536 discrete values. This creates a staircase approximation of the smooth wave.
The Result: A Numerical Sequence
After sampling and quantization, your audio becomes a simple array of integers: [127, 145, 201, 189, ...]. This digital representation can be stored, transmitted, and—crucially for ML—fed into neural networks as input features, just like pixel values in an image.
Key Takeaway: Digital audio converts continuous sound waves into discrete numerical sequences through sampling (capturing amplitude at regular time intervals) and quantization (rounding to fixed precision levels), creating data that machine learning models can process.