Pulse Code Modulation Fundamentals
Sampling and Quantization
From Wave to Number
To digitize an analog signal, we must convert its continuous, flowing nature into a discrete series of numbers. This process, known as analog-to-digital conversion, primarily relies on two key steps: sampling and quantization. The most common framework for this is called Pulse Code Modulation (PCM), which takes a continuous wave and translates it into a binary stream.
How Often to Sample?
The first step, sampling, answers the question: how often do we need to measure the signal's amplitude to capture it faithfully? Taking too few snapshots loses information, while taking too many is inefficient. The answer lies in the Nyquist-Shannon sampling theorem.
The sampling frequency must be greater than twice the highest frequency component of the signal you want to capture. This minimum frequency is known as the Nyquist rate.
For example, the range of human hearing generally tops out around 20 kHz. To accurately represent audio for humans, we need a sampling rate of at least 40 kHz. This is why the standard for CDs was set at 44.1 kHz, providing a safe margin.
Violating this theorem causes a distortion called aliasing, where high frequencies impersonate lower ones. Imagine a movie where a car's wheels appear to spin backward. The camera's frame rate (its sampling rate) is too slow to capture the fast rotation of the spokes, creating a false, slower motion. In audio, aliasing introduces unwanted tones that weren't in the original recording.
To prevent this, engineers use an anti-aliasing filter before the sampling stage. This is a low-pass filter that simply cuts off any frequencies above . By removing any frequencies that couldn't be correctly sampled, it ensures no aliasing can occur.
Measuring the Amplitude
After sampling, we have measurements at discrete points in time, but the amplitude of each measurement is still a continuous value. The next step, quantization, maps these infinite possible amplitudes to a finite set of discrete levels. The number of available levels is determined by the bit depth.
A bit depth of provides possible levels. For instance, an 8-bit system has levels, while a 16-bit system (CD quality) has levels. The process involves rounding the actual amplitude of each sample to the nearest available quantization level. This rounding introduces an unavoidable error, known as quantization error.
This error manifests as a low-level noise, often called quantization noise. The quality of a digital signal is often measured by its Signal-to-Quantization-Noise Ratio (SQNR), which compares the power of the original signal to the power of the noise introduced by quantization. For linear quantization, a simple rule of thumb provides a good estimate.
The quantization described so far is linear quantization, where the steps between levels are all equal in size. This works well for signals that use their full dynamic range. However, for signals like speech, where most of the content is low-amplitude with occasional loud peaks, linear quantization can be inefficient. The many fine levels used for high amplitudes are rarely needed, while the coarse levels at low amplitudes can cause noticeable distortion.
To solve this, non-linear quantization uses steps of varying sizes. It allocates more quantization levels to lower-amplitude signals and fewer levels to higher-amplitude signals. This approach, known as companding (compressing and expanding), is the basis for standards like and A-law used in digital telecommunications. It provides a better perceived signal quality for voice at a lower bit depth than linear quantization would require.
What are the two primary steps involved in Pulse Code Modulation (PCM) for converting an analog signal to a digital one?
What is the primary purpose of an anti-aliasing filter in the analog-to-digital conversion process?
By combining precise sampling in time and detailed quantization in amplitude, PCM provides a robust method for converting the analog world into the digital domain, forming the backbone of modern audio and communication systems.
