Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

μ-law algorithm

From Wikipedia, the free encyclopedia
Audio companding algorithm
This article includes a list ofgeneral references, butit lacks sufficient correspondinginline citations. Please help toimprove this article byintroducing more precise citations.(May 2018) (Learn how and when to remove this message)
Comparison ofA-law (blue) andμ-law (red)compression on an input signal (green). Both axes uselogarithmic scales indecibels.

Problems playing these files? Seemedia help.

Theμ-law algorithm (sometimes writtenmu-law, often abbreviated asu-law) is acompanding algorithm, primarily used in 8-bitPCMdigitaltelecommunications systems inNorth America andJapan. It is one of the two companding algorithms in theG.711 standard fromITU-T, the other being the similarA-law. A-law is used in regions where digital telecommunication signals are carried on E-1 circuits, e.g. Europe.

The termsPCMU, G711u or G711MU are used for G711 μ-law.[1]

Companding algorithms reduce thedynamic range of an audiosignal. In analog systems, this can increase thesignal-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 reducedbandwidth for equivalent SNR.

At the cost of a reduced peak SNR, it can be mathematically shown that μ-law's non-linear quantization effectively increases dynamic range by 33 dB or5+12 bits over a linearly-quantized signal, hence 13.5 bits (which rounds up to 14 bits) is the most resolution required for an input digital signal to be compressed for 8-bit μ-law.[2]

Algorithm types

[edit]

The μ-law algorithm may be described in an analog form and in a quantized digital form.

Continuous

[edit]
μ-law function
Inverse μ-law function

For a given inputx, the equation for μ-law encoding is[3]F(x)=sgn(x)ln(1+μ|x|)ln(1+μ),1x1,{\displaystyle F(x)=\operatorname {sgn}(x){\dfrac {\ln(1+\mu |x|)}{\ln(1+\mu )}},\quad -1\leq x\leq 1,}

whereμ = 255 in the North American and Japanese standards, andsgn(x) is thesign function. Therange of this function is −1 to 1.

μ-law expansion is then given by the inverse equation:[3]F1(y)=sgn(y)(1+μ)|y|1μ,1y1.{\displaystyle F^{-1}(y)=\operatorname {sgn}(y){\dfrac {(1+\mu )^{|y|}-1}{\mu }},\quad -1\leq y\leq 1.}

Discrete

[edit]

The discrete form is defined in ITU-T RecommendationG.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 theC language for a μ-law encoder.[5] The difference between the positive and negative ranges, e.g. the negative range corresponding to +30 to +1 is −31 to −2. This is accounted for by the use of1's complement (simple bit inversion) rather than2's complement to convert a negative value to a positive value during encoding.

Quantized μ-law algorithm
14-bit binary linear input code8-bit compressed code
+8158 to +4063 in 16 intervals of 2560x80 + interval number
+4062 to +2015 in 16 intervals of 1280x90 + interval number
+2014 to +991 in 16 intervals of 640xA0 + interval number
+990 to +479 in 16 intervals of 320xB0 + interval number
+478 to +223 in 16 intervals of 160xC0 + interval number
+222 to +95 in 16 intervals of 80xD0 + interval number
+94 to +31 in 16 intervals of 40xE0 + interval number
+30 to +1 in 15 intervals of 20xF0 + interval number
00xFF
−10x7F
−31 to −2 in 15 intervals of 20x70 + interval number
−95 to −32 in 16 intervals of 40x60 + interval number
−223 to −96 in 16 intervals of 80x50 + interval number
−479 to −224 in 16 intervals of 160x40 + interval number
−991 to −480 in 16 intervals of 320x30 + interval number
−2015 to −992 in 16 intervals of 640x20 + interval number
−4063 to −2016 in 16 intervals of 1280x10 + interval number
−8159 to −4064 in 16 intervals of 2560x00 + interval number

Implementation

[edit]

The μ-law algorithm may be implemented in several ways:

Analog
Use an amplifier with non-linear gain to achieve companding entirely in the analog domain.
Non-linear ADC
Use ananalog-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]

μ-law encoding is used becausespeech has a widedynamic range. In analog signal transmission, in the presence of relatively constant background noise, the finer detail is lost. Given that the precision of the detail is compromised anyway, and assuming that the signal is to be perceived as audio by a human, one can take advantage of the fact that the perceivedacoustic intensity level orloudness is logarithmic by compressing the signal using a logarithmic-response operational amplifier (Weber–Fechner law). In telecommunications circuits, most of the noise is injected on the lines, thus after the compressor, the intended signal is perceived as significantly louder than the static, compared to an uncompressed source. This became a common solution, and thus, prior to common digital usage, the μ-law specification was developed to define an interoperable standard.

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 μ-law in as little as 8 bits, which conveniently matched the symbol size of the majority of common computers.

μ-law encoding effectively reduced the dynamic range of the signal, thereby increasing thecoding efficiency while biasing the signal in a way that results in a signal-to-distortion ratio that is greater than that obtained by linear encoding for a given number of bits.

μ-law decoding as generated with the Sun Microsystems C-language routine g711.c commonly available on the Internet

The μ-law algorithm is also used in the.au format, which dates back at least to theSPARCstation 1 by Sun Microsystems as the native method used by the /dev/audio interface, widely used as a de facto standard for sound on Unix systems. The au format is also used in various common audioAPIs such as the classes in the sun.audioJava package inJava 1.1 and in someC# methods.

This plot illustrates how μ-law concentrates sampling in the smaller (softer) values. The horizontal axis represents the byte values 0-255 and the vertical axis is the 16-bit linear decoded value of μ-law encoding.

Comparison with A-law

[edit]

The μ-law algorithm provides a slightly larger dynamic range than the A-law at the cost of worse proportional distortions for small signals. By convention, A-law is used for an international connection if at least one country uses it.

See also

[edit]

References

[edit]
  1. ^"Video/Voice/Speech Codecs".Grandstream. Retrieved19 July 2020.
  2. ^Ess, David Van (29 December 2014) [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 6 October 2022. Retrieved28 June 2023.
  3. ^ab"Waveform Coding Techniques - Cisco". 2 February 2006. Retrieved7 December 2020.
  4. ^"ITU-T Recommendation G.711".
  5. ^"G.191 : Software tools for speech and audio coding standardization".www.itu.int.

Public Domain This article incorporatespublic domain material fromFederal Standard 1037C.General Services Administration. Archived fromthe original on 22 January 2022.

External links

[edit]
Lossless
type
Entropy
Dictionary
Other
Hybrid
Lossy
type
Transform
Predictive
Audio
Concepts
Codec
parts
Image
Concepts
Methods
Video
Concepts
Codec
parts
Theory
Community
People
Video
compression
ISO,IEC,
MPEG
ITU-T,VCEG
SMPTE
TrueMotion and AOMedia
Chinese Standard
  • AVS1 P2/AVS+(GB/T 20090.2/16)
  • AVS2 P2(GB/T 33475.2,GY/T 299.1)
    • HDR Vivid(GY/T 358)
  • AVS3 P2(GY/T 368)
Others
Audio
compression
ISO,IEC,
MPEG
ITU-T
IETF
3GPP
ETSI
Bluetooth SIG
Chinese Standard
Others
Image
compression
IEC,ISO,IETF,
W3C,ITU-T,JPEG
Others
Containers
ISO,IEC
ITU-T
IETF
SMPTE
Others
Collaborations
Methods
Lists
SeeCompression methods for techniques andCompression software for codecs

Retrieved from "https://en.wikipedia.org/w/index.php?title=Μ-law_algorithm&oldid=1268366746"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp