Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Μ-law algorithm
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Algorithm types== The μ-law algorithm may be described in an analog form and in a quantized digital form. ===Continuous=== [[File:Mu-law function.svg|thumb|μ-law function|350x350px]] [[File:Inverse mu-law function.svg|thumb|Inverse μ-law function|350x350px]] For a given input {{mvar|x}}, the equation for μ-law encoding is<ref name="mulaw-equation">{{cite web |url=https://www.cisco.com/c/en/us/support/docs/voice/h323/8123-waveform-coding.html |title=Waveform Coding Techniques - Cisco |access-date=2020-12-07 |date=2006-02-02}}</ref> <math display="block"> F(x) = \sgn(x) \dfrac{\ln(1 + \mu |x|)}{\ln(1 + \mu)}, \quad -1 \leq x \leq 1, </math> where {{math|1=''μ'' = 255}} in the North American and Japanese standards, and {{math|1=sgn(''x'')}} is the [[sign function]]. The [[Range of a function|range]] of this function is −1 to 1. μ-law expansion is then given by the inverse equation:<ref name="mulaw-equation" /> <math display="block"> F^{-1}(y) = \sgn(y) \dfrac{(1 + \mu)^{|y|} - 1}{\mu}, \quad -1 \leq y \leq 1. </math> ===Discrete=== The discrete form is defined in ITU-T Recommendation [[G.711]].<ref>{{cite web |url=http://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-G.711-198811-I!!PDF-E&type=items |title=ITU-T Recommendation G.711}}</ref> 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|date=October 2016}} However, G.191 provides example code in the [[C language]] for a μ-law encoder.<ref>{{Cite web|url=https://www.itu.int/rec/T-REC-G.191/en|title=G.191 : Software tools for speech and audio coding standardization|website=www.itu.int}}</ref> 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 of [[1's complement]] (simple bit inversion) rather than [[2's complement]] to convert a negative value to a positive value during encoding. {| class="wikitable" |+ Quantized μ-law algorithm ! 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 |}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)