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
G.711
(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!
=== μ-law === {{Main|μ-law algorithm}} The μ-law (sometimes referred to as ulaw, G.711Mu, or G.711μ) encoding takes a 14-bit signed linear audio sample in [[two's complement]] representation as input, inverts all bits after the sign bit if the value is negative, adds 33 (binary 100001) and converts it to an 8 bit value as follows: {| class="wikitable" style="text-align:left" |- ! Linear input value<br><ref group=note>This value is produced by taking the [[two's complement]] representation of the input value, inverting all bits after the sign bit if the value is negative, and adding 33.</ref> ! Compressed code<br>XOR 11111111 ! Linear output value<br><ref group=note>[[Signed magnitude]] representation. Final result is produced by decreasing the magnitude of this value by 33.</ref> |- | <code>s00000001abcdx</code> || <code>s000abcd</code> || <code>s00000001abcd1</code> |- | <code>s0000001abcdxx</code> || <code>s001abcd</code> || <code>s0000001abcd10</code> |- | <code>s000001abcdxxx</code> || <code>s010abcd</code> || <code>s000001abcd100</code> |- | <code>s00001abcdxxxx</code> || <code>s011abcd</code> || <code>s00001abcd1000</code> |- | <code>s0001abcdxxxxx</code> || <code>s100abcd</code> || <code>s0001abcd10000</code> |- | <code>s001abcdxxxxxx</code> || <code>s101abcd</code> || <code>s001abcd100000</code> |- | <code>s01abcdxxxxxxx</code> || <code>s110abcd</code> || <code>s01abcd1000000</code> |- | <code>s1abcdxxxxxxxx</code> || <code>s111abcd</code> || <code>s1abcd10000000</code> |} <references group=note/> Where {{code|s}} is the sign bit, and bits marked {{code|x}} are discarded. In addition, the standard specifies that the encoded bits are inverted before the octet is transmitted. Thus, a silent μ-law encoded PCM channel has the 8 bit samples transmitted 0xFF instead of 0x00 in the octets. Adding 33 is necessary so that all values fall into a compression group and it is subtracted back when decoding. Breaking the encoded value formatted as <code>seeemmmm</code> into 4 bits of mantissa {{var|m}}, 3 bits of exponent {{var|e}} and 1 sign bit {{var|s}}, the decoded linear value {{var|y}} is given by formula :<math>y = (-1)^s \cdot [(33 + 2m) \cdot 2^e - 33],</math> which is a 14-bit signed integer in the range ±0 to ±8031. Note that 0 is transmitted as 0xFF, and −1 is transmitted as 0x7F, but when received the result is 0 in both cases.
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)