Thursday, 17 October 2013

 Compander in PCI Systems

A-Law Compander

A-law is the CCITT recommended companding standard used across Europe. Limiting the linear
sample values to 12 magnitude bits, the A -law compression is defined by Equation  1, where  A is
the compression parameter (A=87.7 in Europe), and xis the normalized integer to be compressed.
Table 1 illustrates an A -law encoding table. The sign bit of the linear input data is omitted from
the table. The sign bit (S) for the 8-bit code is set to 1 if the input sample is negative, and is set to
0 if the input sample is positive.
After the input data is encoded through the logic defined in the table, an inversion pattern is
applied to the 8 -bit code to increase the density of transitions on the transmission line, a benefit to
hardware performance. The inversion pattern is applied by XOR’ing the 8-bit code with 0x55.

Decoding the A -law encoded data is essentially a matter of reversing the steps in the encoding.
Table 2 illustrates the A -law decoding table, applied after reversing the inversion pattern. The
least significant bits discarded in the encoding process are approximated by the median value of
the interval. This is shown in the output section by the trailing 1..0 pattern after the  Dbit.

u- Law Compander

The United States and Japan use  m-law companding. Limiting the linear sample values to 13
magnitude bits, the  m-law compression is defined by Equation 2, where  mis the compression
parameter (m=255 in the U.S. and Japan) and xis the norm alized integer to be compressed.
The encoding and decoding process for  m-law is similar to that of A -law. There are, however, a
few notable differences: 1)  m-law encoders typically operate on linear 13-bit magnitude data, as
opposed to 12-bit magnitude data with A-law, 2) before chord determination a bias value of 33 is
added to the absolute value of the linear input data to simplify the chord and step calculations, 3)
the definition of the sign bit is reversed, and 4) the inversion pattern is applied to all bits in the 8 -bit code.
Table 3 illustrates a m-law encoding table. The sign bit of the linear input data is omitted from the
table. The sign bit (S) for the 8-bit code is set to 1 if the input sample is positive, and is set to 0 if
the input sample is negative.
 After the input data is encoded through the logic defined in the table, an inversion pattern is
applied to the 8 -bit code to increase the density of transitions on the transmission line, a benefit to
hardware performance. The inversion pattern is applied by XOR’ing the 8-bit code with 0xFF.

Decoding the  m  -law encoded data is essentially a matter of reversing the steps in the encoding.
Table 4 illustrates the  m-law decoding table, applied after reversing the inversion pattern. The
least significant bits discarded in the encoding process are approximated by the median value of
the interval. This is shown in the output section by the trailing 1..0 pattern after the  Dbit.

 Summary
There is a wide array of audio transmission systems that employ A -law and/or  m-law companding for data rate reduction with good audio quality. The compression achieved by both A -law and  m-law coding is the result of utilizing the logarithmic characteristics of the human auditory system, where fewer bits of precision are required for larger signals than smaller ones. The logarithmic transfer function is implemented with a piece-wise linear approximation composed of a sign bit, a 3 -bit chord, and a 4 -bit segment. The encoding and decoding process is presented in table format, well suited for hardware or software implementation.