<s>
The	O
μ-law	B-Algorithm
algorithm	I-Algorithm
(	O
sometimes	O
written	O
mu-law	B-Algorithm
,	O
often	O
approximated	O
as	O
u-law	B-Algorithm
)	O
is	O
a	O
companding	B-Algorithm
algorithm	O
,	O
primarily	O
used	O
in	O
8-bit	O
PCM	B-Algorithm
digital	B-General_Concept
telecommunication	O
systems	O
in	O
North	O
America	O
and	O
Japan	O
.	O
</s>
<s>
It	O
is	O
one	O
of	O
two	O
versions	O
of	O
the	O
G.711	B-Algorithm
standard	O
from	O
ITU-T	O
,	O
the	O
other	O
version	O
being	O
the	O
similar	O
A-law	B-Algorithm
.	O
</s>
<s>
A-law	B-Algorithm
is	O
used	O
in	O
regions	O
where	O
digital	B-General_Concept
telecommunication	O
signals	O
are	O
carried	O
on	O
E-1	O
circuits	O
,	O
e.g.	O
</s>
<s>
Companding	B-Algorithm
algorithms	O
reduce	O
the	O
dynamic	O
range	B-Algorithm
of	O
an	O
audio	O
signal	O
.	O
</s>
<s>
In	O
analog	O
systems	O
,	O
this	O
can	O
increase	O
the	O
signal-to-noise	O
ratio	O
(	O
SNR	O
)	O
achieved	O
during	O
transmission	O
;	O
in	O
the	O
digital	B-General_Concept
domain	O
,	O
it	O
can	O
reduce	O
the	O
quantization	O
error	O
(	O
hence	O
increasing	O
the	O
signal-to-quantization-noise	O
ratio	O
)	O
.	O
</s>
<s>
These	O
SNR	O
increases	O
can	O
be	O
traded	O
instead	O
for	O
reduced	O
bandwidth	B-Algorithm
for	O
equivalent	O
SNR	O
.	O
</s>
<s>
The	O
μ-law	B-Algorithm
algorithm	I-Algorithm
may	O
be	O
described	O
in	O
an	O
analog	O
form	O
and	O
in	O
a	O
quantized	O
digital	B-General_Concept
form	O
.	O
</s>
<s>
It	O
is	O
important	O
to	O
note	O
that	O
the	O
range	B-Algorithm
of	O
this	O
function	O
is	O
−1	O
to	O
1	O
.	O
</s>
<s>
μ-law	B-Algorithm
expansion	O
is	O
then	O
given	O
by	O
the	O
inverse	O
equation	O
:	O
</s>
<s>
The	O
discrete	O
form	O
is	O
defined	O
in	O
ITU-T	O
Recommendation	O
G.711	B-Algorithm
.	O
</s>
<s>
G.711	B-Algorithm
is	O
unclear	O
about	O
how	O
to	O
code	O
the	O
values	O
at	O
the	O
limit	O
of	O
a	O
range	B-Algorithm
(	O
e.g.	O
</s>
<s>
However	O
,	O
G.191	O
provides	O
example	O
code	O
in	O
the	O
C	B-Language
language	I-Language
for	O
a	O
μ-law	B-Algorithm
encoder	O
.	O
</s>
<s>
the	O
negative	O
range	B-Algorithm
corresponding	O
to	O
+30	O
to	O
+1	O
is	O
−31	O
to	O
−2	O
.	O
</s>
<s>
This	O
is	O
accounted	O
for	O
by	O
the	O
use	O
of	O
1	O
's	O
complement	O
(	O
simple	O
bit	O
inversion	O
)	O
rather	O
than	O
2	B-General_Concept
's	I-General_Concept
complement	I-General_Concept
to	O
convert	O
a	O
negative	O
value	O
to	O
a	O
positive	O
value	O
during	O
encoding	O
.	O
</s>
<s>
The	O
μ-law	B-Algorithm
algorithm	I-Algorithm
may	O
be	O
implemented	O
in	O
several	O
ways	O
:	O
</s>
<s>
Analog	O
Use	O
an	O
amplifier	O
with	O
non-linear	O
gain	O
to	O
achieve	O
companding	B-Algorithm
entirely	O
in	O
the	O
analog	O
domain	O
.	O
</s>
<s>
Non-linear	O
ADC	O
Use	O
an	O
analog-to-digital	O
converter	O
with	O
quantization	O
levels	O
which	O
are	O
unequally	O
spaced	O
to	O
match	O
the	O
μ-law	B-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
Digital	B-General_Concept
Use	O
the	O
quantized	O
digital	B-General_Concept
version	O
of	O
the	O
μ-law	B-Algorithm
algorithm	I-Algorithm
to	O
convert	O
data	O
once	O
it	O
is	O
in	O
the	O
digital	B-General_Concept
domain	O
.	O
</s>
<s>
Use	O
the	O
continuous	O
version	O
of	O
the	O
μ-law	B-Algorithm
algorithm	I-Algorithm
to	O
calculate	O
the	O
companded	B-Algorithm
values	O
.	O
</s>
<s>
μ-law	B-Algorithm
encoding	O
is	O
used	O
because	O
speech	O
has	O
a	O
wide	O
dynamic	O
range	B-Algorithm
.	O
</s>
<s>
Given	O
that	O
the	O
precision	O
of	O
the	O
detail	O
is	O
compromised	O
anyway	O
,	O
and	O
assuming	O
that	O
the	O
signal	O
is	O
to	O
be	O
perceived	O
as	O
audio	O
by	O
a	O
human	O
,	O
one	O
can	O
take	O
advantage	O
of	O
the	O
fact	O
that	O
the	O
perceived	O
acoustic	O
intensity	O
level	O
or	O
loudness	B-Algorithm
is	O
logarithmic	O
by	O
compressing	O
the	O
signal	O
using	O
a	O
logarithmic-response	O
operational	O
amplifier	O
(	O
Weber-Fechner	O
law	O
)	O
.	O
</s>
<s>
This	O
became	O
a	O
common	O
solution	O
,	O
and	O
thus	O
,	O
prior	O
to	O
common	O
digital	B-General_Concept
usage	O
,	O
the	O
μ-law	B-Algorithm
specification	O
was	O
developed	O
to	O
define	O
an	O
interoperable	O
standard	O
.	O
</s>
<s>
This	O
pre-existing	O
algorithm	O
had	O
the	O
effect	O
of	O
significantly	O
lowering	O
the	O
amount	O
of	O
bits	O
required	O
to	O
encode	O
a	O
recognizable	O
human	O
voice	O
in	O
digital	B-General_Concept
systems	O
.	O
</s>
<s>
A	O
sample	O
could	O
be	O
effectively	O
encoded	O
using	O
μ-law	B-Algorithm
in	O
as	O
little	O
as	O
8	O
bits	O
,	O
which	O
conveniently	O
matched	O
the	O
symbol	O
size	O
of	O
the	O
majority	O
of	O
common	O
computers	O
.	O
</s>
<s>
μ-law	B-Algorithm
encoding	O
effectively	O
reduced	O
the	O
dynamic	O
range	B-Algorithm
of	O
the	O
signal	O
,	O
thereby	O
increasing	O
the	O
coding	O
efficiency	O
while	O
biasing	O
the	O
signal	O
in	O
a	O
way	O
that	O
results	O
in	O
a	O
signal-to-distortion	O
ratio	O
that	O
is	O
greater	O
than	O
that	O
obtained	O
by	O
linear	O
encoding	O
for	O
a	O
given	O
number	O
of	O
bits	O
.	O
</s>
<s>
The	O
μ-law	B-Algorithm
algorithm	I-Algorithm
is	O
also	O
used	O
in	O
the	O
.au	O
format	O
,	O
which	O
dates	O
back	O
at	O
least	O
to	O
the	O
SPARCstation	B-Architecture
1	I-Architecture
by	O
Sun	O
Microsystems	O
as	O
the	O
native	O
method	O
used	O
by	O
the	O
/dev/audio	O
interface	O
,	O
widely	O
used	O
as	O
a	O
de	O
facto	O
standard	O
for	O
sound	O
on	O
Unix	O
systems	O
.	O
</s>
<s>
The	O
au	O
format	O
is	O
also	O
used	O
in	O
various	O
common	O
audio	O
APIs	B-Application
such	O
as	O
the	O
classes	O
in	O
the	O
sun.audio	O
Java	B-Language
package	I-Language
in	O
Java	B-Device
1.1	O
and	O
in	O
some	O
C#	B-Application
methods	O
.	O
</s>
<s>
This	O
plot	O
illustrates	O
how	O
μ-law	B-Algorithm
concentrates	O
sampling	O
in	O
the	O
smaller	O
(	O
softer	O
)	O
values	O
.	O
</s>
<s>
The	O
horizontal	O
axis	O
represents	O
the	O
byte	O
values	O
0-255	O
and	O
the	O
vertical	O
axis	O
is	O
the	O
16-bit	O
linear	O
decoded	O
value	O
of	O
μ-law	B-Algorithm
encoding	O
.	O
</s>
<s>
The	O
μ-law	B-Algorithm
algorithm	I-Algorithm
provides	O
a	O
slightly	O
larger	O
dynamic	O
range	B-Algorithm
than	O
the	O
A-law	B-Algorithm
at	O
the	O
cost	O
of	O
worse	O
proportional	O
distortions	O
for	O
small	O
signals	O
.	O
</s>
<s>
By	O
convention	O
,	O
A-law	B-Algorithm
is	O
used	O
for	O
an	O
international	O
connection	O
if	O
at	O
least	O
one	O
country	O
uses	O
it	O
.	O
</s>
