AI Glossary / MLOps and deployment / Intermediate

Companding

Definition

Companding combines compression and expansion of a signal's amplitude range. A nonlinear compressor changes the range before transmission, storage or quantization, and a corresponding expander reverses that mapping as far as the intervening process permits.

What it means

Small signals and large signals may need different effective precision. A compressive mapping can give relatively more representational detail to low-amplitude values while accommodating a wide input range. After decoding, expansion restores the intended amplitude relationship approximately. This differs from general lossless file compression, which represents the same data with fewer bits through coding. Companding changes the signal representation and is often combined with quantization, making the complete process lossy. A-law and μ-law speech coding are familiar examples, though companding is a broader principle.

How it works

Apply a monotonic nonlinear mapping that compresses the dynamic range, quantize or transmit the mapped values, then apply an inverse expansion at the receiver. Uniform quantization in the compressed domain corresponds to nonuniform spacing when mapped back to the original amplitude domain.
Logarithmic or piecewise approximations can provide useful tradeoffs between implementation complexity and signal quality. The encoder and decoder must use compatible laws, scales and code conventions. In exact arithmetic with no intervening loss, an invertible compressor and expander could cancel. Quantization, clipping and channel errors prevent perfect cancellation in practical systems. Error behavior should be assessed in the reconstructed signal domain.

Three practical examples

  • A telephony codec represents speech amplitudes using a specified A-law or μ-law mapping.
  • A sensor pipeline uses a nonlinear encoding to allocate numerical precision across a wide signal range.
  • A signal-processing lesson compares uniform quantization with companded quantization for weak and strong inputs.

Think of it this way

Think of using a measuring scale with closely spaced marks near zero and wider spacing at large values. It can describe small quantities finely while still covering a broad range. The analogy describes nonuniform effective resolution, but real companding uses a compressor and matching expansion, with errors introduced by the intervening representation.

Worked example

For an illustrative positive-only mapping, let C(x) = √x for x between 0 and 1, with inverse E(y) = y². Quantize the compressed value to the nearest 0.1. If x = 0.01, C(x) = 0.1 and reconstruction returns 0.01 exactly. If x = 0.04, it similarly returns 0.04.
Near the upper end, compressed levels 0.8, 0.9 and 1.0 reconstruct as 0.64, 0.81 and 1.0, with much wider spacing than levels 0.1 and 0.2, which reconstruct as 0.01 and 0.04. This toy square-root law illustrates nonuniform precision; it is not the A-law or μ-law formula or a standard-compliant codec.

Illustrative case study

In a fictional voice-device prototype, engineers compare two encoding paths at the same number of output codes. A companded representation allocates finer effective steps to weak speech amplitudes, but the team also checks stronger signals, clipping and compatibility with the decoder. A mismatched decoding law produces an obviously altered signal. The team verifies the exact format rather than treating all eight-bit speech data as interchangeable. This case illustrates representation compatibility without claiming a universal quality improvement for every input.

Common misconceptions and mistakes

Companding is not simply lowering the volume, because it changes relative amplitude spacing nonlinearly. Expansion does not recover distinctions already lost to quantization. It is also different from a standalone audio dynamics compressor used for a creative effect, although related nonlinear ideas can appear in both. Another mistake is assuming that equal code widths imply equal steps in the original signal after expansion. The purpose of companding is often precisely to make those effective steps nonuniform.

Business use

For communication or measurement systems, choose the mapping according to signal characteristics and the required error distribution. Document the law, scale, clipping behavior and decoder expectations. Evaluate both weak and strong signals, including silence or near-zero values where numerical conventions can matter. If the signal feeds an AI model, test the decoded representation used in practice. A representation that suits human listening may affect machine features differently, so end-to-end evaluation remains necessary.

People also ask

Is companding lossless?

An ideal invertible mapping can be reversed, but practical companding with quantization or clipping generally loses information.

Why use smaller steps for weak signals?

It can reduce relative quantization error where uniform steps would be large compared with the signal amplitude.

Are A-law and μ-law interchangeable?

No. They use different coding conventions and require compatible interpretation or an explicit conversion.

Check your understanding

A compressed-domain quantizer has equally spaced levels. Must its expanded output levels also be equally spaced?

Answer: No. The nonlinear expansion changes the spacing, producing nonuniform effective quantization in the original domain.

Related terms

  • Dynamic range
  • nonlinear encoding
  • quantization
  • A-law
  • μ-law
  • pulse-code modulation
  • compressor
  • expander
  • signal-to-noise ratio

Learn next

Learn nonuniform quantization next. Draw a compressive mapping and its inverse, then map evenly spaced encoded levels back to the input domain to see where precision is concentrated.

More in MLOps and deployment

  • Coding tree unit - A coding tree unit, or CTU, is a top-level picture-partitioning unit used in video coding, notably HEVC.
  • Cognitive computing - Cognitive computing is a broad term for computing approaches intended to support tasks associated with human cognition, such as interpreting language...
  • Color space - A color space is a defined system for representing colors with numerical coordinates and an interpretation of those coordinates.
  • Compressed data structure - A compressed data structure stores information in a space-efficient representation while supporting useful operations without first expanding the entire...
  • Compressed pattern matching - Compressed pattern matching searches for a pattern in data represented in compressed form, using the compression structure or a suitable index to avoid...
  • Compressed suffix array - A compressed suffix array is a space-efficient representation supporting operations associated with a suffix array, such as searching a text for a pattern...

Sources

Texas Instruments, A-Law and mu-Law Companding Implementations: https://www.ti.com.cn/cn/lit/an/spra163a/spra163a.pdf ITU-T, G.711 pulse-code modulation recommendation: https://www.itu.int/rec/T-REC-G.711/en Primary engineering and standards search excerpts consulted; full source and editorial review remain pending.

Previous: Compactly supported kernel Next: Comparative trial

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer