μ -law algorithm
This article includes a list of general references, but it lacks sufficient corresponding inline citations. (May 2018) |
The
The terms PCMU, G711u or G711MU are used for G711
Companding algorithms reduce the dynamic range of an audio signal. In analog systems, this can increase the signal-to-noise ratio (SNR) achieved during transmission; in the digital domain, it can reduce the quantization error (hence increasing the signal-to-quantization-noise ratio). These SNR increases can be traded instead for reduced bandwidth for equivalent SNR.
At the cost of a reduced peak SNR, it can be mathematically shown that
Algorithm types
[edit]The
Continuous
[edit]For a given input x, the equation for
where
Discrete
[edit]The discrete form is defined in ITU-T Recommendation G.711.[4]
G.711 is unclear about how to code the values at the limit of a range (e.g. whether +31 codes to 0xEF or 0xF0).[citation needed]
However, G.191 provides example code in the C language for a
14-bit binary linear input code | 8-bit compressed code |
---|---|
+8158 to +4063 in 16 intervals of 256 | 0x80 + interval number |
+4062 to +2015 in 16 intervals of 128 | 0x90 + interval number |
+2014 to +991 in 16 intervals of 64 | 0xA0 + interval number |
+990 to +479 in 16 intervals of 32 | 0xB0 + interval number |
+478 to +223 in 16 intervals of 16 | 0xC0 + interval number |
+222 to +95 in 16 intervals of 8 | 0xD0 + interval number |
+94 to +31 in 16 intervals of 4 | 0xE0 + interval number |
+30 to +1 in 15 intervals of 2 | 0xF0 + interval number |
0 | 0xFF |
−1 | 0x7F |
−31 to −2 in 15 intervals of 2 | 0x70 + interval number |
−95 to −32 in 16 intervals of 4 | 0x60 + interval number |
−223 to −96 in 16 intervals of 8 | 0x50 + interval number |
−479 to −224 in 16 intervals of 16 | 0x40 + interval number |
−991 to −480 in 16 intervals of 32 | 0x30 + interval number |
−2015 to −992 in 16 intervals of 64 | 0x20 + interval number |
−4063 to −2016 in 16 intervals of 128 | 0x10 + interval number |
−8159 to −4064 in 16 intervals of 256 | 0x00 + interval number |
Implementation
[edit]The
- Analog
- Use an amplifier with non-linear gain to achieve companding entirely in the analog domain.
- Non-linear ADC
- Use an analog-to-digital converter with quantization levels which are unequally spaced to match the
μ -law algorithm. - Digital
- Use the quantized digital version of the
μ -law algorithm to convert data once it is in the digital domain.
- Software/DSP
- Use the continuous version of the
μ -law algorithm to calculate the companded values.
Usage justification
[edit]This pre-existing algorithm had the effect of significantly lowering the amount of bits required to encode a recognizable human voice in digital systems. A sample could be effectively encoded using
The
This plot illustrates how
Comparison with A-law
[edit]The
See also
[edit]- Dynamic range compression
- Signal compression (disambiguation)
- G.711, a waveform speech coder using either A-law or
μ -law encoding - Tapered floating point
References
[edit]- ^ "Video/Voice/Speech Codecs". Grandstream=. Retrieved 19 July 2020.
- ^ Ess, David Van (2014-12-29) [2007-10-09]. "Cypress Semiconductor AN2095: Algorithm - Logarithmic Signal Companding - Not Just a Good Idea - It Is
μ -Law" (PDF). Infineon Technologies. Archived (PDF) from the original on 2022-10-06. Retrieved 2023-06-28. - ^ a b "Waveform Coding Techniques - Cisco". 2006-02-02. Retrieved 2020-12-07.
- ^ "ITU-T Recommendation G.711".
- ^ "G.191 : Software tools for speech and audio coding standardization". www.itu.int.
This article incorporates public domain material from Federal Standard 1037C. General Services Administration. Archived from the original on 2022-01-22.