Hubbry Logo
CompandingCompandingMain
Open search
Companding
Community hub
Companding
logo
8 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Contribute something
Companding
Companding
from Wikipedia

A signal before (top) and after μ-law compression (bottom)

In telecommunications and signal processing, companding (occasionally called compansion) is a method of mitigating the detrimental effects of a channel with limited dynamic range. The name is a portmanteau of the words compressing and expanding, which are the functions of a compander at the transmitting and receiving ends, respectively. The use of companding allows signals with a large dynamic range to be transmitted over facilities that have a smaller dynamic range capability. Companding is employed in telephony and other audio applications such as professional wireless microphones and analog recording.

How it works

[edit]

The dynamic range of a signal is compressed before transmission and is expanded to the original value at the receiver. The electronic circuit that does this is called a compander and works by compressing or expanding the dynamic range of an analog electronic signal such as sound recorded by a microphone. One variety is a triplet of amplifiers: a logarithmic amplifier, followed by a variable-gain linear amplifier, and ending with an exponential amplifier. Such a triplet has the property that its output voltage is proportional to the input voltage raised to an adjustable power.

Companded quantization is the combination of three functional building blocks – namely, a (continuous-domain) signal dynamic range compressor, a limited-range uniform quantizer, and a (continuous-domain) signal dynamic range expander that inverts the compressor function. This type of quantization is frequently used in telephony systems.[1][2]

In practice, companders are designed to operate according to relatively simple dynamic range compressor functions that are suitable for implementation as simple analog electronic circuits. The two most popular compander functions used for telecommunications are the A-law and μ-law functions.

Applications

[edit]

Companding is used in digital telephony systems, compressing before input to an analog-to-digital converter, and then expanding after a digital-to-analog converter. This is equivalent to using a non-linear ADC as in a T-carrier telephone system that implements A-law or μ-law companding. This method is also used in digital file formats for better signal-to-noise ratio (SNR) at lower bit depths. For example, a linearly encoded 16-bit PCM signal can be converted to an 8-bit WAV or AU file while maintaining a decent SNR by compressing before the transition to 8-bit and expanding after conversion back to 16-bit. This is effectively a form of lossy audio data compression.

Professional wireless microphones do this since the dynamic range of the microphone audio signal itself is larger than the dynamic range provided by radio transmission. Companding also reduces the noise and crosstalk levels at the receiver.[3]

Companders are used in concert audio systems and in some noise reduction schemes.

History

[edit]

The use of companding in an analog picture transmission system was patented by A. B. Clark of AT&T in 1928 (filed in 1925):[4]

In the transmission of pictures by electric currents, the method which consists in sending currents varied in a non-linear relation to the light values of the successive elements of the picture to be transmitted, and at the receiving end exposing corresponding elements of a sensitive surface to light varied in inverse non-linear relation to the received current.

— A. B. Clark patent

In 1942, Clark and his team completed the SIGSALY secure voice transmission system that included the first use of companding in a PCM (digital) system.[5]

In 1953, B. Smith showed that a nonlinear DAC could be complemented by the inverse nonlinearity in a successive-approximation ADC configuration, simplifying the design of digital companding systems.[6]

In 1970, H. Kaneko developed the uniform description of segment (piecewise linear) companding laws that had by then been adopted in digital telephony.[7]

In the 1980s and 1990s, many of the music equipment manufacturers (Roland, Yamaha, Korg) used companding when compressing the library waveform data in their digital synthesizers. However, exact algorithms are unknown, neither if any of the manufacturers ever used the Companding scheme which is described in this article. The only known thing is that manufacturers did use data compression[8] in the mentioned time period and that some people refer to it as companding while in reality it might mean something else, for example data compression and expansion.[9] This dates back to the late '80s when memory chips were often one of the most costly components in the instrument. Manufacturers usually quoted the amount of memory in its compressed form: i.e. 24 MB of physical waveform ROM in a Korg Trinity is actually 48 MB when uncompressed. Similarly, Roland SR-JV expansion boards were usually advertised as 8 MB boards with '16 MB-equivalent content'. Careless copying of this technical information, omitting the equivalence reference, can often cause confusion.

References

[edit]
[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
Companding, a portmanteau of "compression" and "expansion," is a technique that mitigates the effects of limited in communication channels by compressing the amplitude of an prior to quantization and , then expanding it upon reception to approximate the original . This process is essential for efficient transmission of signals like speech, which exhibit a wide spanning over 40 dB or more, allowing uniform quantization steps to allocate more resolution to quieter signals while compressing louder ones logarithmically. By employing nonlinear quantization, companding improves the signal-to-quantization ratio (SQNR) for low-amplitude signals without increasing the number of bits per sample, typically reducing from 12-16 bits to 8 bits in (PCM) systems. The concept of companding originated in the 1920s, with its first patent for an analog picture transmission system filed in 1925 and issued in 1928 to Alva B. Clark of , aiming to adaptively handle varying signal amplitudes in early image transmission. Over the following decades, it evolved into a cornerstone of digital , particularly for , where it enables the transmission of voice over band-limited channels like the 4 kHz bandwidth used in networks. In modern standards, companding is defined by the G.711 recommendation, which specifies two primary algorithms: μ-law (mu-law), predominant in and with a compression μ = 255 for slightly better signal-to-noise performance, and A-law, used in and international systems with A = 87.6, offering a broader at the cost of minor low-level . These logarithmic companding laws approximate the nonlinear response of the human ear, ensuring that quantization remains perceptually uniform across levels, and are implemented via piecewise linear segments or lookup tables in digital systems. Beyond , companding finds applications in audio recording, wireless microphones, and data compression for , where it balances bandwidth efficiency with . Despite its age, companding remains relevant in legacy and embedded systems, though newer codecs like often supersede it for higher-quality .

Overview

Definition and Purpose

Companding is a technique derived from the portmanteau of "compression" and "expansion," employed to compress the dynamic range of an analog signal at the transmitter before quantization and subsequently expand it at the receiver to restore an approximation of the original . This method effectively transforms a nonuniform quantization process into an equivalent uniform one after expansion, optimizing the representation of the signal in digital form. The core purpose of companding lies in mitigating quantization noise within (PCM) systems, particularly by allocating a greater proportion of quantization levels to lower-amplitude signal components that are inherently more vulnerable to noise distortion. This approach enhances the overall , allowing wide signals—such as speech spanning about 40 dB—to be transmitted efficiently across channels constrained by limited bandwidth and bit depth. In voice communication scenarios, for instance, companding safeguards against in intense speech elements like shouting while maintaining clarity for subtle sounds such as whispers, ensuring perceptual uniformity across varying input levels.

Basic Principles

Companding operates by compressing the of an input at the transmitter and subsequently expanding it at the receiver, enabling efficient transmission over channels with constrained capabilities. The typical signal flow begins with the analog input, which is fed into a that applies a nonlinear mapping to attenuate larger amplitudes more aggressively than smaller ones, thereby compressing the overall range and allocating more relative resolution to quieter signal components. This compressed signal then undergoes uniform quantization and encoding before transmission. At the receiving end, after decoding, the signal passes through an expander that inverts the compression to recover the original , yielding an output that approximates the input signal. The functions as a nonlinear device that warps the signal's distribution, preferentially boosting the relative scale of weak samples while suppressing strong ones, which reduces the effective step sizes for low-level signals during subsequent quantization. This process effectively achieves nonuniform quantization without requiring a complex quantizer, as the nonlinearity preconditions the signal for uniform steps. Conversely, the expander serves as the inverse counterpart, applying a complementary nonlinear transformation to counteract the compression, thereby restoring the relationships and minimizing in the reconstructed signal. Together, the and expander form a compandor that enhances overall by concentrating quantization resources where they are most needed. A core principle of companding is the use of a logarithmic-like nonlinearity, which mirrors the perceptual scaling of human hearing by emphasizing differences in low-amplitude regions over high ones. Human auditory perception follows a roughly logarithmic relationship between physical and subjective sensation, as encapsulated in the Weber-Fechner law, motivating companding to make quantization errors less noticeable to listeners, particularly for subtle speech elements. In contrast to linear processing, which maintains constant gain across all amplitudes and thus amplifies quantization noise proportionally—making it more prominent in quiet signals—companding deliberately distorts the scale to equalize noise perceptibility. Linear amplification preserves amplitude ratios but fails to address the heightened audibility of noise at low levels, whereas companding's warping improves the for weaker components without expanding the transmission bandwidth. This approach is particularly beneficial in bandwidth-limited systems, where uniform linear quantization would otherwise degrade performance for signals with wide dynamic ranges.

Mathematical Foundations

Compression Process

The compression process in companding applies a non-linear transformation to the input signal to diminish its before quantization, enabling more efficient representation with fewer bits while preserving perceptual quality. For μ-law companding, the mathematical formulation for the compression function is given by F(x)=\sgn(x)ln(1+μxxmax)ln(1+μ),F(x) = \sgn(x) \cdot \frac{\ln\left(1 + \mu \cdot \frac{|x|}{|x_{\max}|}\right)}{\ln(1 + \mu)}, where xx is the input signal, xmax|x_{\max}| is the peak (often normalized to 1), and μ>0\mu > 0 is the compression parameter controlling the degree of non-linearity (typically μ = 255). This logarithmic transformation derives from the need to allocate more quantization levels to lower-amplitude signals, which are perceptually more important in applications like speech. For small x|x|, the function approximates a linear response with a steep initial slope of approximately μ/ln(1+μ)\mu / \ln(1 + \mu), but as x|x| increases, the slope decreases, compressing higher amplitudes more severely relative to lower ones. This uneven compression allows uniform quantization to cover a wider effective input range without excessive noise in quiet passages. The compressed output y=F(x)y = F(x) is then subjected to uniform quantization, typically into 256 levels for 8-bit representation, which translates to non-uniform steps in the original signal domain. Because the compression mapping expands the lower end of the , small input signals receive finer effective resolution, minimizing quantization error where is most critical. In practical digital systems, the smooth logarithmic curve of F(x)F(x) is approximated by piecewise linear segments to enable low-complexity hardware or software , often using 8 linear sections aligned with the quantization intervals for . The resulting transfer characteristic of y=F(x)y = F(x) resembles an S-shaped curve: nearly linear near x=0x = 0 to preserve detail in quiet signals, then progressively flattening toward xmax|x_{\max}| to suppress peaks and prevent clipping. For A-law companding, the compression is defined piecewise: F(x)=\sgn(x)Axxmax1+lnAfor0x11+lnA,F(x) = \sgn(x) \frac{A \frac{|x|}{|x_{\max}|}}{1 + \ln A} \quad \text{for} \quad 0 \leq |x| \leq \frac{1}{1 + \ln A}, F(x)=\sgn(x)1+ln(Axxmax)1+lnAfor11+lnA<x1,F(x) = \sgn(x) \frac{1 + \ln \left( A \frac{|x|}{|x_{\max}|} \right)}{1 + \ln A} \quad \text{for} \quad \frac{1}{1 + \ln A} < |x| \leq 1, with A = 87.6, providing a hybrid linear-logarithmic response.

Expansion Process

The expansion process in companding serves as the inverse operation to compression, reconstructing the original signal's dynamic range from the compressed and quantized representation. The expander applies a nonlinear transformation to the input y, which is the output of the quantizer, to recover an approximation of the original signal x. For μ-law companding, the continuous expansion function is given by G(y)=sgn(y)ymaxμ[(1+μ)y/ymax1],G(y) = \operatorname{sgn}(y) \cdot \frac{|y_{\max}|}{\mu} \left[ (1 + \mu)^{|y| / |y_{\max}|} - 1 \right], where sgn(y)\operatorname{sgn}(y) denotes the sign function, ymax|y_{\max}| is the maximum magnitude of the compressed signal (often normalized to 1), and μ\mu is the compression parameter (typically 255). This formula ensures that small input values are amplified more aggressively than large ones, restoring the signal's amplitude distribution. For A-law, the expansion is the inverse piecewise function matching the compression. During expansion, quantization noise introduced in the compressed domain can be amplified, particularly for low-amplitude signals, as the expander boosts these regions to match the original . However, the overall (SNR) improves because the pre-compression step allocates finer quantization steps to weaker signals, resulting in an effective increase of approximately 33 dB compared to linear 8-bit quantization. This trade-off prioritizes perceptual quality in applications like speech, where low-level details are critical. Expanders can be implemented in analog or digital domains. Analog expanders often employ diode-based circuits or logarithmic amplifiers configured for exponential response, using feedback paths with diodes to approximate the anti-logarithmic curve for real-time signal recovery. In contrast, digital expanders typically use lookup tables mapping quantized codes to linear output values or algorithmic computations for efficiency, requiring minimal cycles (e.g., 3-13 per sample) on processors like DSPs but potentially more memory for tables. Precise matching between the compressor's and expander's parameters, such as μ\mu and scaling factors, is essential to prevent mismatch distortion, which arises from incomplete inversion and introduces nonlinear artifacts like "breathing" or tonal shifts in the reconstructed signal. The full round-trip process yields xG(F(x))x \approx G(F(x)), where FF denotes compression, achieving near-perfect recovery for unquantized signals within the valid range but with residual error due to quantization steps.

Types of Companding

μ-law Companding

μ-law companding is a logarithmic compression algorithm standardized for use in and , primarily in digital systems to encode 8-bit (PCM) signals. It applies a nonlinear transformation to the input signal, compressing the to allocate more quantization levels to lower-amplitude signals, which improves for speech. The standard parameter is μ = 255, which provides a compression factor that emphasizes low-level signals more strongly due to the higher value of μ. The compression function for μ-law is given by F(x)=sgn(x)ln(1+255x)ln(256),F(x) = \operatorname{sgn}(x) \cdot \frac{\ln(1 + 255 |x|)}{\ln(256)}, where xx is the normalized input signal in the range [-1, 1], sgn(x)\operatorname{sgn}(x) is the , and the output is also normalized to [-1, 1]. This piecewise linear approximation divides the signal range into 8 chords, each containing 16 segments, resulting in 256 total quantization levels for 8-bit encoding. The chord boundaries increase exponentially, with each subsequent chord covering a range twice as large as the previous one, allowing finer resolution for smaller signals. In the encoding process, the 8-bit codeword consists of 1 , 3 bits for the chord number, and 4 bits for the segment (step) within the chord; the is inverted (complemented) before transmission to ensure the all-zero represents . For example, a small negative input signal like -2460 (in a 14-bit linear representation) is biased and mapped to a compressed of E3 in , which is then inverted to 1C for transmission, demonstrating how low-amplitude inputs receive precise step sizes relative to their range. This structure ensures that small signals, such as quiet speech, are quantized with smaller steps compared to larger signals, enhancing overall perceptual quality.

A-law Companding

A-law companding is a logarithmic compression technique standardized in Recommendation for use in European and international systems. It employs a A=87.6A = 87.6, providing a balance between optimization and signal fidelity. The compression function F(x)F(x) for a normalized input signal xx (where 1x1-1 \leq x \leq 1) is defined piecewise to achieve this logarithmic behavior: F(x)={sgn(x)Ax1+lnA0x<1Asgn(x)1+ln(Ax)1+lnA1Ax1F(x) = \begin{cases} \text{sgn}(x) \cdot \dfrac{A |x|}{1 + \ln A} & 0 \leq |x| < \dfrac{1}{A} \\ \text{sgn}(x) \cdot \dfrac{1 + \ln (A |x|)}{1 + \ln A} & \dfrac{1}{A} \leq |x| \leq 1 \end{cases}
Add your contribution
Related Hubs
Contribute something
User Avatar
No comments yet.