<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.tachyony.co.uk/w/index.php?action=history&amp;feed=atom&amp;title=A-law_algorithm</id>
	<title>A-law algorithm - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.tachyony.co.uk/w/index.php?action=history&amp;feed=atom&amp;title=A-law_algorithm"/>
	<link rel="alternate" type="text/html" href="https://wiki.tachyony.co.uk/w/index.php?title=A-law_algorithm&amp;action=history"/>
	<updated>2026-07-06T20:19:41Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://wiki.tachyony.co.uk/w/index.php?title=A-law_algorithm&amp;diff=42969&amp;oldid=prev</id>
		<title>imported&gt;Kvng: unpiped links using script</title>
		<link rel="alternate" type="text/html" href="https://wiki.tachyony.co.uk/w/index.php?title=A-law_algorithm&amp;diff=42969&amp;oldid=prev"/>
		<updated>2026-04-27T17:15:18Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/w/index.php?title=WP:NOPIPE&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;WP:NOPIPE (page does not exist)&quot;&gt;unpiped&lt;/a&gt; links using &lt;a href=&quot;/w/index.php?title=User:Nardog/Unpipe&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User:Nardog/Unpipe (page does not exist)&quot;&gt;script&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Audio companding in communications}}&lt;br /&gt;
{{no footnotes|date=February 2013}}&lt;br /&gt;
&lt;br /&gt;
[[File:Comparison of A-law and μ-law compression on an input signal.svg|thumb|Comparison of [[A-law]] (blue) and [[μ-law]] (red) [[Dynamic range compression|compression]] on an input signal (green). Both axes use [[logarithmic scale]] in [[decibels]].|350x350px]]&lt;br /&gt;
[[File:Plot of F(x) for A-Law for A = 87.6.svg|thumb|Plot of &amp;#039;&amp;#039;F&amp;#039;&amp;#039;(&amp;#039;&amp;#039;x&amp;#039;&amp;#039;) for A-Law for &amp;#039;&amp;#039;A&amp;#039;&amp;#039; = 87.6|350x350px]]&lt;br /&gt;
{{Listen&lt;br /&gt;
| type         = speech&lt;br /&gt;
| header       = Audio quality comparison&lt;br /&gt;
| filename     = Speech 12dB s16.flac&lt;br /&gt;
| title        = 16-bit linear PCM (reference/original)&lt;br /&gt;
| filename2    = Speech 12dB alaw8.flac&lt;br /&gt;
| title2       = 8-bit A-law PCM&lt;br /&gt;
| filename3    = Speech 12dB u8.flac&lt;br /&gt;
| title3       = 8-bit linear PCM&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
An &amp;#039;&amp;#039;&amp;#039;A-law algorithm&amp;#039;&amp;#039;&amp;#039; is a standard [[companding]] algorithm, used in [[Europe]]an eight-bit [[PCM]] [[digital communications]] systems to optimize, i.e. modify, the [[dynamic range]] of an [[analog signal]] for digitizing. It is one of the two companding algorithms in the [[G.711]] standard from [[ITU-T]], the other being the similar [[μ-law]], used in North America and Japan.&lt;br /&gt;
&lt;br /&gt;
For a given input &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;, the equation for A-law encoding is as follows:&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;&lt;br /&gt;
F(x) = \sgn(x) \begin{cases}&lt;br /&gt;
    \dfrac{A |x|}{1 + \ln(A)}, &amp;amp; |x| &amp;lt; \dfrac{1}{A},&lt;br /&gt;
    \\[1ex]&lt;br /&gt;
    \dfrac{1+ \ln(A |x|)}{1 + \ln(A)}, &amp;amp; \dfrac{1}{A} \leq |x| \leq 1,&lt;br /&gt;
\end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; is the compression parameter. In Europe, &amp;lt;math&amp;gt;A = 87.6&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A-law expansion is given by the inverse function:&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;&lt;br /&gt;
F^{-1}(y) = \sgn(y) \begin{cases}&lt;br /&gt;
    \dfrac{|y| (1 + \ln(A))}{A}, &amp;amp;  |y| &amp;lt; \dfrac{1}{1 + \ln(A)},&lt;br /&gt;
    \\&lt;br /&gt;
    \dfrac{e^{-1 + |y| (1 + \ln(A))}}{A}, &amp;amp; \dfrac{1}{1 + \ln(A)} \leq |y| &amp;lt; 1.&lt;br /&gt;
\end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reason for this encoding is that the wide [[dynamic range]] of [[speech]] does not lend itself well to efficient linear digital encoding. A-law encoding effectively reduces the dynamic range of the signal, thereby increasing the [[Channel coding|coding]] efficiency and resulting in a signal-to-[[distortion]] ratio that is superior to that obtained by linear encoding for a given number of bits.&lt;br /&gt;
&lt;br /&gt;
== Comparison to μ-law ==&lt;br /&gt;
The [[μ-law algorithm]] provides a slightly larger dynamic range than the A-law at the cost of worse proportional distortion for small signals. By convention, A-law is used for an international connection if at least one country uses it.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[μ-law algorithm]]&lt;br /&gt;
* [[Dynamic range compression]]&lt;br /&gt;
* [[Signal compression]]&lt;br /&gt;
* [[Companding]]&lt;br /&gt;
* [[G.711]]&lt;br /&gt;
* [[DS0]]&lt;br /&gt;
* [[Tapered floating point]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://www.cisco.com/en/US/tech/tk1077/technologies_tech_note09186a00801149b3.shtml Waveform Coding Techniques] - Has details of implementation (but note that the A-law equation is incorrect)&lt;br /&gt;
* [https://github.com/deftio/companders A-law implementation in C-language with example code]&lt;br /&gt;
{{Compression Methods}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Audio codecs]]&lt;br /&gt;
[[Category:Data compression]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Kvng</name></author>
	</entry>
</feed>