Speech & Audio AI / Representing Sound
Turning a pressure wave into numbers.
Reviewed by Yuvaraj
A sound is a wave of changing air pressure, and a computer cannot store a wave, it can only store numbers. Every speech and audio model therefore begins with the same quiet, consequential step: turning a continuous pressure wave into a finite list of numbers. This lesson covers how that conversion works, sampling in time and quantizing in amplitude, and the two dials, sampling rate and bit depth, that decide how faithfully the digital copy matches the original sound. Get this step wrong and no amount of clever modeling downstream can recover what was lost.
A microphone measures air pressure at its diaphragm and produces a voltage that rises and falls exactly as the pressure does. That analog signal is continuous in two dimensions at once:
A computer has finite memory, so it can keep neither continuum. Analog-to-digital conversion (ADC) discretizes both: it samples the signal at regular instants (handling time) and quantizes each sample to one of a fixed set of levels (handling amplitude). Sampling rate controls the first dimension; bit depth controls the second. The stored result, a plain array of integers, one per sample, is called PCM (pulse-code modulation), and it is what a .wav file holds.
Ask about this lesson, or about anything in AI. Answers cite the lessons they draw on.
Finished this lesson?
Mark it complete to earn XP, keep your streak, and schedule a review.
The sampling rate is how many times per second we record the signal's value, measured in hertz (Hz). CD audio uses Hz, 44,100 readings every second.
How high does need to be? The Nyquist–Shannon sampling theorem gives an exact answer: to represent a signal without loss, the sampling rate must be at least twice the highest frequency present in it.
Turned around, a given sampling rate faithfully captures frequencies only up to the Nyquist frequency, half the sampling rate:
Human hearing tops out around 20 kHz, so capturing every audible frequency needs kHz; CD's 44.1 kHz leaves a small margin for the anti-aliasing filter. Speech energy, by contrast, lives mostly below 8 kHz, so telephone and many speech-recognition pipelines sample at 16 kHz, enough to make speech intelligible while storing far less data.
Aliasing: the price of sampling too slowly
A frequency above the Nyquist limit does not simply vanish when you sample, it folds back and masquerades as a lower frequency that was never in the original sound. This is aliasing, and it is irreversible: once two frequencies collide into the same samples, no algorithm can separate them again. Real ADCs apply an analog anti-aliasing filter to remove above-Nyquist content before sampling, which is exactly why practical sampling rates sit a little above twice the target bandwidth.
Sampling decides when we read the signal; bit depth decides how precisely each reading is stored. With bits per sample there are distinct amplitude levels available:
So 8-bit audio has levels, while 16-bit audio (the CD standard) has . Because a real amplitude almost never lands exactly on a level, each sample is rounded to the nearest one, introducing a small quantization error. More bits mean smaller steps and a better signal-to-noise ratio; a good rule of thumb is roughly 6 dB of headroom per bit:
At 16 bits that is about 96 dB, comfortably beyond what the ear resolves, which is why 16-bit is the consumer standard. Production and mastering often use 24-bit to leave room for editing before the final render.
The raw (uncompressed) data rate follows directly from the three dials, rate, depth, and number of channels:
data rate = sample_rate x (bit_depth / 8 bytes) x channels
CD audio, stereo, 1 second:
44,100 samples/s x 2 bytes x 2 channels = 176,400 bytes/s
-> about 172 KiB per second, ~10.1 MiB per minute
16 kHz mono speech, 1 second:
16,000 samples/s x 2 bytes x 1 channel = 32,000 bytes/s
-> about 31 KiB per second
Music-grade CD audio costs roughly 5.5x the bytes of 16 kHz mono speech per second, the reason ASR pipelines standardize on the lower rate is not just history but bandwidth and compute. (These figures are for uncompressed PCM; codecs like MP3, Opus, and AAC shrink them dramatically by discarding perceptually irrelevant detail.)
Common mistakes