Companding

Non-linear quantization using A-law and µ-law to improve SNR for low-amplitude signals.

The Problem: The Weakness of Linear Quantization

Before understanding companding, we must first understand the problem it brilliantly solves. In a standard PCM system, is used. This works well for signals with a uniform distribution, but it's very inefficient for signals with a high , like human speech.

Imagine recording a conversation that includes both a whisper and a shout. Linear quantization uses the same step size for both. For the loud shout, the quantization error is small relative to the signal's amplitude and is barely noticeable. However, for the quiet whisper, the very same error can be as large as the signal itself, severely degrading its quality and making it sound noisy. The human ear is much more sensitive to noise in quiet passages, making this problem even more pronounced. This constant error level results in a poor Signal-to-Quantization-Noise Ratio (SQNR) for low-amplitude signals.

The Solution: Companding

Companding is a portmanteau of its two stages: COMpressing the signal at the transmitter and exPANDING it at the receiver. It's a non-linear process designed to improve the SQNR of signals with a high dynamic range, effectively solving the problem of linear quantization for signals like voice.

How it Works

The core idea is to manipulate the signal's dynamic range before quantization. At the transmitter, a compressor circuit amplifies quiet (low-amplitude) signals more than it amplifies loud (high-amplitude) signals. This "squeezes" the overall dynamic range, lifting the weak parts of the signal further away from the inherent quantization noise floor. This compressed signal is then linearly quantized. At the receiver, an expander circuit performs the exact opposite operation, attenuating the quiet parts more than the loud parts to restore the original dynamic range.

Visualizing the Process: The Compression Curve

The non-linear behavior of a compressor is best understood by looking at its transfer function, or compression curve. This graph plots the output amplitude against the input amplitude.

For an input signal xx and an output signal yy, a linear system would be y=xy=x. A compression curve, however, is shaped like a logarithm. For small input values near zero, the slope of the curve is very steep, indicating high amplification. As the input signal amplitude increases, the slope becomes flatter, indicating less amplification. This ensures that quiet sounds get a significant boost, while loud sounds are kept in check.

Global Standards: A-law and µ-law

To ensure global interoperability, two main companding algorithms were standardized by the ITU-T for use in digital telephony systems.

  • A-law: Used primarily in Europe and most of the rest of the world. It provides a slightly more linear section for very low-level signals. Its compression parameter is A=87.6A=87.6.
    The A-law formula for a normalized input x|x| is:
    F(x)={Ax1+ln(A),x<1/A1+ln(Ax)1+ln(A),1/Ax1F(x) = \begin{cases} \frac{A|x|}{1+\ln(A)}, & |x| < 1/A \\ \frac{1+\ln(A|x|)}{1+\ln(A)}, & 1/A \le |x| \le 1 \end{cases}
  • µ-law (mu-law): Used in North America and Japan. It offers a slightly larger dynamic range than A-law. Its compression parameter is μ=255\mu=255.
    The µ-law formula for a normalized input x|x| is:
    F(x)=ln(1+μx)ln(1+μ)F(x) = \frac{\ln(1+\mu|x|)}{\ln(1+\mu)}

Digital Implementation: Piecewise-Linear Approximation

Implementing a smooth logarithmic curve in digital hardware is complex. In practice, the A-law and µ-law curves are approximated by a series of straight-line segments. For example, the A-law standard is often implemented by mapping a 12-bit linear PCM signal into a special 8-bit companded format.

The signal range is divided into segments (e.g., 8 positive and 8 negative for A-law). The segments near zero are very narrow, meaning they have very small quantization steps (high precision for quiet sounds). As the signal amplitude increases, the segments become progressively wider, using larger steps for louder sounds where the error is less perceptible.

8-bit Companded Word Format

The resulting 8-bit word cleverly encodes this information:

  • 1 bit: Sign bit (positive or negative).
  • 3 bits: Segment identifier (which of the 8 segments the sample falls into).
  • 4 bits: The specific quantization level (one of 16) within that segment.

The Result: Drastically Improved Efficiency

By using companding, an 8-bit PCM system can achieve a dynamic range and SQNR for speech that is comparable to a 12-bit or 13-bit linear PCM system. This massive efficiency gain is what made the 64 kbps digital voice channel possible.

8000 samples/second × 8 bits/sample = 64,000 bits/second (64 kbps)

This 64 kbps rate became the fundamental building block for global digital telephony networks (like ISDN) and laid the groundwork for modern digital communication.

    Companding | Teleinf Edu