What is PCM?

Core Definition: Pulse Code Modulation is the most fundamental, direct, and common method for converting analog audio signals into digital signals. It forms the cornerstone of almost all digital audio.

A Great Analogy: Restoring a Painting with LEGO Bricks
Imagine you want to recreate a continuous oil painting using LEGO bricks.

  1. Sampling: You decide to take a color sample every centimeter along the horizontal direction. The sampling rate is how many times you take a sample per second (e.g., 44,100 points per second).
  2. Quantization: You have a standard set of LEGO brick colors, for example 65,536 colors. For each sample point’s color, you pick the closest brick from this standard set. The bit depth is the total number of standard colors you have (e.g., 16-bit gives 2^16 = 65,536 colors).
  3. Encoding: Finally, you record the number of each chosen colored brick to create an assembly instruction manual.

PCM is the digital embodiment of this process: through sampling and quantization, it turns a continuous analog waveform into a discrete sequence of level values represented by binary numbers.

How PCM Works: Three Steps
The PCM encoding process can be clearly broken down into three key steps, as illustrated below:

Analog audio signal (continuous waveform) → Sampling (discretized in time) → Quantization (discretized in amplitude) → Encoding (converted to binary code) → PCM digital audio (a sequence of binary numbers)

1. Sampling

  • What it does: At fixed time intervals (determined by the sampling rate, e.g., 44.1 kHz), it measures the amplitude of the analog waveform. This is like representing a continuous line with a series of discrete points.
  • Goal: Capture the frequency information of the signal. According to the Nyquist theorem, the sampling rate must be at least twice the highest frequency of the signal.

2. Quantization

  • What it does: On the amplitude axis, it rounds the infinitely precise amplitude value measured at each sample point to the nearest discrete level. The number of these levels is determined by the bit depth (e.g., 16-bit gives 65,536 levels).
  • Impact: Determines the signal’s dynamic range and precision. Lower bit depth results in larger quantization error (i.e., quantization noise).

3. Encoding

  • What it does: Converts each quantized level value into a corresponding binary code (for example, with 16-bit, each sample point is represented by a 16-bit binary number).
  • Result: The final output is PCM data – a long sequence of binary numbers arranged in chronological order.

Key Characteristics of PCM

1. Uncompressed Raw Data
PCM itself is uncompressed. It faithfully records the amplitude value of each sample point, without using psychoacoustic models to discard "unimportant" data as MP3 or AAC do. Therefore it is considered a lossless format, but at the cost of large file sizes.

Formula for calculating PCM file size:
File size ≈ Sampling rate × Bit depth × Number of channels × Time

For example, a 5‑minute CD‑quality (44.1 kHz, 16‑bit, stereo) uncompressed WAV (PCM) file:
44,100 Hz × 16 bits × 2 × 300 seconds ≈ 50.6 MB

2. As a Digital Audio Interface
At the hardware level, PCM is also a standard digital audio interface protocol. It defines how digital audio data is transmitted between devices (e.g., between a DAC chip and a digital signal processor). A typical PCM interface includes the following signal lines:

  • BCLK (Bit Clock): Provides clock synchronization for each bit.
  • DATA (Data Line): Carries the actual data, transmitting the binary value of each sample in order.
  • LRCK (Left‑Right Clock): Indicates whether the current data belongs to the left or right channel.
  • MCLK (Master Clock): Typically a multiple of the sampling rate, it provides a reference clock for the chip’s internal operation.

The common I²S interface is a specific form of PCM interface, widely used in consumer audio products.

Common Container Formats for PCM
Raw PCM data needs to be packaged in a file container for storage and identification. The most common container formats are:

  • WAV: Developed by Microsoft and IBM, this is the most common lossless audio format on Windows, typically containing PCM data.
  • AIFF: Developed by Apple, the corresponding lossless audio format on Mac systems.
  • CD‑DA: The Red Book standard for audio CDs – its physical format is 44.1 kHz, 16‑bit, stereo PCM.

Advantages and Disadvantages of PCM

Advantages:

  • High fidelity: Raw data, no loss in quality.
  • Simple encoding/decoding: Low CPU load during processing, good real‑time performance.
  • Universality: It is the "lingua franca" of digital audio, supported by all software and hardware platforms.
  • Ideal for post‑processing: The best source format for audio editing, mixing, and mastering.

Disadvantages:

  • Very large file size: Consumes significant storage and bandwidth.
  • No metadata: A raw PCM stream cannot store information such as artist name or album artwork (this requires a container format like WAV).

PCM and Other Formats

  • PCM vs. Bitstream: PCM is decoded, ready‑to‑use digital audio data. In contrast, compressed bitstreams like Dolby Digital or DTS are encoded data packets that require a decoder to convert them back to PCM before the DAC can turn them into an analog signal.
  • PCM vs. Compressed formats: MP3, AAC, Ogg, etc. are all lossy compressions of PCM – they sacrifice some sound quality for much smaller file sizes. FLAC and ALAC are lossless compressions of PCM – they reduce file size but can be perfectly restored to the original PCM.
  • PCM vs. DSD: DSD is another high‑resolution audio coding method that uses a 1‑bit bit depth but an extremely high sampling rate (e.g., 2.8 MHz). It is fundamentally different from PCM and represents a parallel technological path.

Summary and Outlook
PCM is the foundation and common language of the digital audio world. Whether you are listening to MP3, streaming music, or high‑resolution files, at some point in the signal chain (especially just before the digital‑to‑analog converter) it is almost always converted to PCM for processing.

Practical Insights for Users:

  1. Why is it so important? Because it is the "source format". When doing audio creation or editing, you should always use PCM‑based formats (e.g., WAV, AIFF) to retain the highest quality.
  2. How should you think about it? Treat it as the "raw material" or "unprocessed negative" of digital audio. Other compressed formats are the "finished photos" created for convenient distribution and playback.
  3. Will it be replaced in the future? Despite alternatives like DSD, thanks to its simplicity, universality, and mature ecosystem, PCM will remain the absolute mainstream and core of digital audio for the foreseeable future.