SlideShare a Scribd company logo
1 of 4
Download to read offline
A-Law/Mu-Law Companding
Revision 1.0

Introduction
Pulse code modulation (PCM) is a common method of digitizing or quantizing an analog waveform. For
any analog-to-digital conversion process, the quantization step produces an estimate of the waveform
sample using a digital codeword. This digital estimate inherently contains some level of error due to the
finite number of bits available. In practical terms, there is always tradeoff between the amount of error and
the size of the digital data samples. The goal in any system design is quantizi ng the data in smallest
number of bits that results in a tolerable level of error. In the case of speech coding, linear quantization
with 13 bits sampled at 8 KHz is the minimum required to accurately produce a digital representation of the
full range of speech signals. For many transmission systems, wired or wireless, 13 bits sampled at 8 KHz
is an expensive proposition as far as bandwidth is concerned. To address this constraint, a companding
system is often employed.
Companding is simply a system in which information is first compressed, transmitted through a bandwidthlimited channel, and expanded at the receiving end. It is frequently used to reduce the bandwidth
requirements for transmitting telephone quality speech, by reducing the 13-bit codewords to 8-bit
codewords. Two international standards for encoding signal data to 8-bit codes are A-law and µ-law. Alaw is the accepted European standard, while µ-law is the accepted standard in the United States and Japan.

Speech Companding
The human auditory system is believed to be a logarithmic process in which high amplitude sounds do not
require the same resolution as low amplitude sounds. The human ear is more sensitive to quantization
noise in small signals than large signals. A-law and µ-law coding apply a logarithmic quantization function
to adjust the data resolution in proportion to the level of the input signal. Smaller signals are represented
with greater precision – more data bits – than larger signals. The result is fewer bits per sample to maintain
an audible signal-to-noise ratio (SNR).
Rather than taking the logarithm of the linear input data directly, which can be computationally difficult, Alaw/µ-law PCM matches the logarithmic curve with a piece-wise linear approximation. Eight straight-line
segments along the curve produce a close approximation to the logarithm function. Each segment is known
as a chord. Within each chord, the piece-wise linear approximation is divided into equally size
quantization intervals called steps. The step size between adjacent codewords is doubled in each
succeeding chord. Also encoded is the sign bit for the original integer. The result is an 8-bit logarithmic
code composed of a 1-bit sign bit, a 3-bit chord, and a 4-bit step.

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 x is the normalized integer to be compressed.

F(x) =

A* x
1 + ln( A)

0≤ x <

sgn(x ) * (1 + ln( A x ))
1 + ln( A)

1
≤ x ≤1
A

Equation 1, A-Law Definition

1
A
A-Law/Mu-Law Companding

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.

Linear Input Data
0
0
0
0
0
0
0
1

0
0
0
0
0
0
1
A

0
0
0
0
0
1
A
B

0
0
0
0
1
A
B
C

0
0
0
1
A
B
C
D

0
0
1
A
B
C
D
X

0
1
A
B
C
D
X
X

A
A
B
C
D
X
X
X

B
B
C
D
X
X
X
X

A-law Encoded Output
C
C
D
X
X
X
X
X

D
D
X
X
X
X
X
X

X
X
X
X
X
X
X
X

S
S
S
S
S
S
S
S

0
0
0
0
1
1
1
1

0
0
1
1
0
0
1
1

0
1
0
1
0
1
0
1

A
A
A
A
A
A
A
A

B
B
B
B
B
B
B
B

C
C
C
C
C
C
C
C

D
D
D
D
D
D
D
D

Table 1, A-Law Encoding

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 D bit.

A-law Encoded Input
S
S
S
S
S
S
S
S

0
0
0
0
1
1
1
1

0
0
1
1
0
0
1
1

0
1
0
1
0
1
0
1

A
A
A
A
A
A
A
A

B
B
B
B
B
B
B
B

C
C
C
C
C
C
C
C

Linear Output Data
D
D
D
D
D
D
D
D

0
0
0
0
0
0
0
1

0
0
0
0
0
0
1
A

0
0
0
0
0
1
A
B

0
0
0
0
1
A
B
C

0
0
0
1
A
B
C
D

0
0
1
A
B
C
D
1

0
1
A
B
C
D
1
0

A
A
B
C
D
1
0
0

B
B
C
D
1
0
0
0

C
C
D
1
0
0
0
0

D
D
1
0
0
0
0
0

1
1
0
0
0
0
0
0

Table 2, A-Law Decoding

Page 2 of 4

Young Engineering: www.young-engineering.com
A-Law/Mu-Law Companding

µ-Law Compander
The United States and Japan use µ-law companding. Limiting the linear sample values to 13
magnitude bits, the µ-law compression is defined by Equation 2, where µ is the compression
parameter (µ =255 in the U.S. and Japan) and x is the normalized integer to be compressed.

F(x) =

sgn(x ) * ln(1 + µ x ))
ln(1 + µ )

0≤ x ≤1

Equation 2, µ-Law Definition
The encoding and decoding process for µ-law is similar to that of A-law. There are, however, a
few notable differences: 1) µ-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 8bit code.
Table 3 illustrates 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 positive, and is set to 0 if
the input sample is negative.

µ-law Encoded Output

Linear Input Data
0
0
0
0
0
0
0
1

0
0
0
0
0
0
1
A

0
0
0
0
0
1
A
B

0
0
0
0
1
A
B
C

0
0
0
1
A
B
C
D

0
0
1
A
B
C
D
X

0
1
A
B
C
D
X
X

1
A
B
C
D
X
X
X

A
B
C
D
X
X
X
X

B
C
D
X
X
X
X
X

C
D
X
X
X
X
X
X

D
X
X
X
X
X
X
X

X
X
X
X
X
X
X
X

S
S
S
S
S
S
S
S

0
0
0
0
1
1
1
1

0
0
1
1
0
0
1
1

0
1
0
1
0
1
0
1

A
A
A
A
A
A
A
A

B
B
B
B
B
B
B
B

C
C
C
C
C
C
C
C

D
D
D
D
D
D
D
D

Table 3, µ-Law Encoding
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 µ -law encoded data is essentially a matter of reversing the steps in the encoding.
Table 4 illustrates the µ-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 D bit.

Young Engineering: www.young-engineering.com

Page 3 of 4
A-Law/Mu-Law Companding

µ-law Encoded Input
S
S
S
S
S
S
S
S

0
0
0
0
1
1
1
1

0
0
1
1
0
0
1
1

0
1
0
1
0
1
0
1

A
A
A
A
A
A
A
A

B
B
B
B
B
B
B
B

C
C
C
C
C
C
C
C

Linear Output Data
D
D
D
D
D
D
D
D

0
0
0
0
0
0
0
1

0
0
0
0
0
0
1
A

0
0
0
0
0
1
A
B

0
0
0
0
1
A
B
C

0
0
0
1
A
B
C
D

0
0
1
A
B
C
D
1

0
1
A
B
C
D
1
0

1
A
B
C
D
1
0
0

A
B
C
D
1
0
0
0

B
C
D
1
0
0
0
0

C
D
1
0
0
0
0
0

D
1
0
0
0
0
0
0

1
0
0
0
0
0
0
0

Table 4, µ-Law Decoding

Summary
There is a wide array of audio transmission systems that employ A-law and/or µ-law companding for data
rate reduction with good audio quality. The compression achieved by both A-law and µ-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.

Page 4 of 4

Young Engineering: www.young-engineering.com

More Related Content

What's hot

Digital modulation technique
Digital modulation techniqueDigital modulation technique
Digital modulation techniqueNidhi Baranwal
 
Orthogonal Frequency Division Multiplexing (OFDM)
Orthogonal Frequency Division Multiplexing (OFDM)Orthogonal Frequency Division Multiplexing (OFDM)
Orthogonal Frequency Division Multiplexing (OFDM)Gagan Randhawa
 
Demodulation of AM wave
Demodulation of AM waveDemodulation of AM wave
Demodulation of AM waveLokesh Parihar
 
Delta modulation
Delta modulationDelta modulation
Delta modulationmpsrekha83
 
Digital modulation techniques
Digital modulation techniquesDigital modulation techniques
Digital modulation techniquesmpsrekha83
 
EC 8395 - Communication Engineering - Unit 3 m - ary signaling
EC 8395 - Communication Engineering - Unit 3   m - ary signalingEC 8395 - Communication Engineering - Unit 3   m - ary signaling
EC 8395 - Communication Engineering - Unit 3 m - ary signalingKannanKrishnana
 
219272664 s-parameters
219272664 s-parameters219272664 s-parameters
219272664 s-parametersManish Arora
 
4. free space path loss model part 2
4. free space path loss model   part 24. free space path loss model   part 2
4. free space path loss model part 2JAIGANESH SEKAR
 
wirelessSlidesCh04 (2).ppt
wirelessSlidesCh04 (2).pptwirelessSlidesCh04 (2).ppt
wirelessSlidesCh04 (2).pptasodariyabhavesh
 
FHSS- Frequency Hop Spread Spectrum
FHSS- Frequency Hop Spread SpectrumFHSS- Frequency Hop Spread Spectrum
FHSS- Frequency Hop Spread SpectrumRohit Choudhury
 
8085 addressing modes
8085 addressing modes8085 addressing modes
8085 addressing modesVijay Kumar
 
Pulse Code Modulation (PCM)
Pulse Code Modulation (PCM)Pulse Code Modulation (PCM)
Pulse Code Modulation (PCM)Arun c
 
Cyclic code non systematic
Cyclic code non systematicCyclic code non systematic
Cyclic code non systematicNihal Gupta
 
8085 microprocessor
8085 microprocessor8085 microprocessor
8085 microprocessorAnuja Gunale
 

What's hot (20)

Digital modulation technique
Digital modulation techniqueDigital modulation technique
Digital modulation technique
 
Orthogonal Frequency Division Multiplexing (OFDM)
Orthogonal Frequency Division Multiplexing (OFDM)Orthogonal Frequency Division Multiplexing (OFDM)
Orthogonal Frequency Division Multiplexing (OFDM)
 
Waveform coding
Waveform codingWaveform coding
Waveform coding
 
Demodulation of AM wave
Demodulation of AM waveDemodulation of AM wave
Demodulation of AM wave
 
Delta modulation
Delta modulationDelta modulation
Delta modulation
 
Line coding
Line codingLine coding
Line coding
 
Communication protocols - Embedded Systems
Communication protocols - Embedded SystemsCommunication protocols - Embedded Systems
Communication protocols - Embedded Systems
 
Digital modulation techniques
Digital modulation techniquesDigital modulation techniques
Digital modulation techniques
 
EC 8395 - Communication Engineering - Unit 3 m - ary signaling
EC 8395 - Communication Engineering - Unit 3   m - ary signalingEC 8395 - Communication Engineering - Unit 3   m - ary signaling
EC 8395 - Communication Engineering - Unit 3 m - ary signaling
 
219272664 s-parameters
219272664 s-parameters219272664 s-parameters
219272664 s-parameters
 
4. free space path loss model part 2
4. free space path loss model   part 24. free space path loss model   part 2
4. free space path loss model part 2
 
5 linear block codes
5 linear block codes5 linear block codes
5 linear block codes
 
Microprocessor
MicroprocessorMicroprocessor
Microprocessor
 
wirelessSlidesCh04 (2).ppt
wirelessSlidesCh04 (2).pptwirelessSlidesCh04 (2).ppt
wirelessSlidesCh04 (2).ppt
 
FHSS- Frequency Hop Spread Spectrum
FHSS- Frequency Hop Spread SpectrumFHSS- Frequency Hop Spread Spectrum
FHSS- Frequency Hop Spread Spectrum
 
8085 addressing modes
8085 addressing modes8085 addressing modes
8085 addressing modes
 
Pulse Code Modulation (PCM)
Pulse Code Modulation (PCM)Pulse Code Modulation (PCM)
Pulse Code Modulation (PCM)
 
Cyclic code non systematic
Cyclic code non systematicCyclic code non systematic
Cyclic code non systematic
 
Dc unit iii final ppt
Dc unit iii final pptDc unit iii final ppt
Dc unit iii final ppt
 
8085 microprocessor
8085 microprocessor8085 microprocessor
8085 microprocessor
 

Similar to A_law_and_Microlaw_companding

FPGA Design & Simulation Modeling of Baseband Data Transmission System
FPGA Design & Simulation Modeling of Baseband Data Transmission SystemFPGA Design & Simulation Modeling of Baseband Data Transmission System
FPGA Design & Simulation Modeling of Baseband Data Transmission SystemIOSR Journals
 
Digital-transmission.pptx
Digital-transmission.pptxDigital-transmission.pptx
Digital-transmission.pptxDennisA6
 
Turbo equalizer
Turbo equalizerTurbo equalizer
Turbo equalizerrashp8
 
Digital Signal Conditioning
Digital Signal ConditioningDigital Signal Conditioning
Digital Signal ConditioningGhansyam Rathod
 
Optimizing Data Encoding Technique For Dynamic Power Reduction In Network On ...
Optimizing Data Encoding Technique For Dynamic Power Reduction In Network On ...Optimizing Data Encoding Technique For Dynamic Power Reduction In Network On ...
Optimizing Data Encoding Technique For Dynamic Power Reduction In Network On ...IRJET Journal
 
EE352 - Final Project Report
EE352 - Final Project ReportEE352 - Final Project Report
EE352 - Final Project ReportRob Garrone
 
Design and implementation of log domain decoder
Design and implementation of log domain decoder Design and implementation of log domain decoder
Design and implementation of log domain decoder IJECEIAES
 
Meeting w10 chapter 3 part 3
Meeting w10   chapter 3 part 3Meeting w10   chapter 3 part 3
Meeting w10 chapter 3 part 3Hattori Sidek
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)IJERD Editor
 
An ECG-SoC with 535nW/Channel Lossless Data Compression for Wearable Sensors
An ECG-SoC with 535nW/Channel Lossless Data Compression for Wearable SensorsAn ECG-SoC with 535nW/Channel Lossless Data Compression for Wearable Sensors
An ECG-SoC with 535nW/Channel Lossless Data Compression for Wearable Sensorsecgpapers
 
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...IJCSEA Journal
 
Design and Performance Analysis of Convolutional Encoder and Viterbi Decoder ...
Design and Performance Analysis of Convolutional Encoder and Viterbi Decoder ...Design and Performance Analysis of Convolutional Encoder and Viterbi Decoder ...
Design and Performance Analysis of Convolutional Encoder and Viterbi Decoder ...IJERA Editor
 
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...IJCSEA Journal
 
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...IJCSEA Journal
 
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...IJCSEA Journal
 

Similar to A_law_and_Microlaw_companding (20)

G5243336
G5243336G5243336
G5243336
 
FPGA Design & Simulation Modeling of Baseband Data Transmission System
FPGA Design & Simulation Modeling of Baseband Data Transmission SystemFPGA Design & Simulation Modeling of Baseband Data Transmission System
FPGA Design & Simulation Modeling of Baseband Data Transmission System
 
Digital-transmission.pptx
Digital-transmission.pptxDigital-transmission.pptx
Digital-transmission.pptx
 
H5243740
H5243740H5243740
H5243740
 
lec5_13.pptx
lec5_13.pptxlec5_13.pptx
lec5_13.pptx
 
Turbo equalizer
Turbo equalizerTurbo equalizer
Turbo equalizer
 
Digital Signal Conditioning
Digital Signal ConditioningDigital Signal Conditioning
Digital Signal Conditioning
 
Optimizing Data Encoding Technique For Dynamic Power Reduction In Network On ...
Optimizing Data Encoding Technique For Dynamic Power Reduction In Network On ...Optimizing Data Encoding Technique For Dynamic Power Reduction In Network On ...
Optimizing Data Encoding Technique For Dynamic Power Reduction In Network On ...
 
EE352 - Final Project Report
EE352 - Final Project ReportEE352 - Final Project Report
EE352 - Final Project Report
 
Design and implementation of log domain decoder
Design and implementation of log domain decoder Design and implementation of log domain decoder
Design and implementation of log domain decoder
 
Meeting w10 chapter 3 part 3
Meeting w10   chapter 3 part 3Meeting w10   chapter 3 part 3
Meeting w10 chapter 3 part 3
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)
 
Real time signal processing
Real time signal processingReal time signal processing
Real time signal processing
 
An ECG-SoC with 535nW/Channel Lossless Data Compression for Wearable Sensors
An ECG-SoC with 535nW/Channel Lossless Data Compression for Wearable SensorsAn ECG-SoC with 535nW/Channel Lossless Data Compression for Wearable Sensors
An ECG-SoC with 535nW/Channel Lossless Data Compression for Wearable Sensors
 
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...
 
Design and Performance Analysis of Convolutional Encoder and Viterbi Decoder ...
Design and Performance Analysis of Convolutional Encoder and Viterbi Decoder ...Design and Performance Analysis of Convolutional Encoder and Viterbi Decoder ...
Design and Performance Analysis of Convolutional Encoder and Viterbi Decoder ...
 
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...
 
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...
 
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...
NON-STATISTICAL EUCLIDEAN-DISTANCE SISO DECODING OF ERROR-CORRECTING CODES OV...
 
K034066071
K034066071K034066071
K034066071
 

More from Akshay Sharma

Eye monitored wheel chair control for people suffering from quadriplegia
Eye monitored wheel chair control for people suffering from quadriplegiaEye monitored wheel chair control for people suffering from quadriplegia
Eye monitored wheel chair control for people suffering from quadriplegiaAkshay Sharma
 
The next generation classroom smart, interactive and connected learning envir...
The next generation classroom smart, interactive and connected learning envir...The next generation classroom smart, interactive and connected learning envir...
The next generation classroom smart, interactive and connected learning envir...Akshay Sharma
 
Over voltage protector circuit
Over voltage protector circuitOver voltage protector circuit
Over voltage protector circuitAkshay Sharma
 
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...Akshay Sharma
 
Ldr based line follower robot
Ldr based line follower robotLdr based line follower robot
Ldr based line follower robotAkshay Sharma
 
Arduino Full Tutorial
Arduino Full TutorialArduino Full Tutorial
Arduino Full TutorialAkshay Sharma
 

More from Akshay Sharma (14)

Eye monitored wheel chair control for people suffering from quadriplegia
Eye monitored wheel chair control for people suffering from quadriplegiaEye monitored wheel chair control for people suffering from quadriplegia
Eye monitored wheel chair control for people suffering from quadriplegia
 
The buzzer glove
The buzzer gloveThe buzzer glove
The buzzer glove
 
The next generation classroom smart, interactive and connected learning envir...
The next generation classroom smart, interactive and connected learning envir...The next generation classroom smart, interactive and connected learning envir...
The next generation classroom smart, interactive and connected learning envir...
 
Over voltage protector circuit
Over voltage protector circuitOver voltage protector circuit
Over voltage protector circuit
 
Haptic technology
Haptic technologyHaptic technology
Haptic technology
 
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...
 
8085 instructions
8085 instructions8085 instructions
8085 instructions
 
Ldr based line follower robot
Ldr based line follower robotLdr based line follower robot
Ldr based line follower robot
 
Arduino Full Tutorial
Arduino Full TutorialArduino Full Tutorial
Arduino Full Tutorial
 
Est 11
Est 11Est 11
Est 11
 
Est 8 2 nd
Est 8 2 ndEst 8 2 nd
Est 8 2 nd
 
Est 8 1 st
Est 8 1 stEst 8 1 st
Est 8 1 st
 
Est 6
Est 6Est 6
Est 6
 
Est 1
Est 1Est 1
Est 1
 

Recently uploaded

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 

Recently uploaded (20)

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 

A_law_and_Microlaw_companding

  • 1. A-Law/Mu-Law Companding Revision 1.0 Introduction Pulse code modulation (PCM) is a common method of digitizing or quantizing an analog waveform. For any analog-to-digital conversion process, the quantization step produces an estimate of the waveform sample using a digital codeword. This digital estimate inherently contains some level of error due to the finite number of bits available. In practical terms, there is always tradeoff between the amount of error and the size of the digital data samples. The goal in any system design is quantizi ng the data in smallest number of bits that results in a tolerable level of error. In the case of speech coding, linear quantization with 13 bits sampled at 8 KHz is the minimum required to accurately produce a digital representation of the full range of speech signals. For many transmission systems, wired or wireless, 13 bits sampled at 8 KHz is an expensive proposition as far as bandwidth is concerned. To address this constraint, a companding system is often employed. Companding is simply a system in which information is first compressed, transmitted through a bandwidthlimited channel, and expanded at the receiving end. It is frequently used to reduce the bandwidth requirements for transmitting telephone quality speech, by reducing the 13-bit codewords to 8-bit codewords. Two international standards for encoding signal data to 8-bit codes are A-law and µ-law. Alaw is the accepted European standard, while µ-law is the accepted standard in the United States and Japan. Speech Companding The human auditory system is believed to be a logarithmic process in which high amplitude sounds do not require the same resolution as low amplitude sounds. The human ear is more sensitive to quantization noise in small signals than large signals. A-law and µ-law coding apply a logarithmic quantization function to adjust the data resolution in proportion to the level of the input signal. Smaller signals are represented with greater precision – more data bits – than larger signals. The result is fewer bits per sample to maintain an audible signal-to-noise ratio (SNR). Rather than taking the logarithm of the linear input data directly, which can be computationally difficult, Alaw/µ-law PCM matches the logarithmic curve with a piece-wise linear approximation. Eight straight-line segments along the curve produce a close approximation to the logarithm function. Each segment is known as a chord. Within each chord, the piece-wise linear approximation is divided into equally size quantization intervals called steps. The step size between adjacent codewords is doubled in each succeeding chord. Also encoded is the sign bit for the original integer. The result is an 8-bit logarithmic code composed of a 1-bit sign bit, a 3-bit chord, and a 4-bit step. 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 x is the normalized integer to be compressed. F(x) = A* x 1 + ln( A) 0≤ x < sgn(x ) * (1 + ln( A x )) 1 + ln( A) 1 ≤ x ≤1 A Equation 1, A-Law Definition 1 A
  • 2. A-Law/Mu-Law Companding 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. Linear Input Data 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 A 0 0 0 0 0 1 A B 0 0 0 0 1 A B C 0 0 0 1 A B C D 0 0 1 A B C D X 0 1 A B C D X X A A B C D X X X B B C D X X X X A-law Encoded Output C C D X X X X X D D X X X X X X X X X X X X X X S S S S S S S S 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 A A A A A A A A B B B B B B B B C C C C C C C C D D D D D D D D Table 1, A-Law Encoding 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 D bit. A-law Encoded Input S S S S S S S S 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 A A A A A A A A B B B B B B B B C C C C C C C C Linear Output Data D D D D D D D D 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 A 0 0 0 0 0 1 A B 0 0 0 0 1 A B C 0 0 0 1 A B C D 0 0 1 A B C D 1 0 1 A B C D 1 0 A A B C D 1 0 0 B B C D 1 0 0 0 C C D 1 0 0 0 0 D D 1 0 0 0 0 0 1 1 0 0 0 0 0 0 Table 2, A-Law Decoding Page 2 of 4 Young Engineering: www.young-engineering.com
  • 3. A-Law/Mu-Law Companding µ-Law Compander The United States and Japan use µ-law companding. Limiting the linear sample values to 13 magnitude bits, the µ-law compression is defined by Equation 2, where µ is the compression parameter (µ =255 in the U.S. and Japan) and x is the normalized integer to be compressed. F(x) = sgn(x ) * ln(1 + µ x )) ln(1 + µ ) 0≤ x ≤1 Equation 2, µ-Law Definition The encoding and decoding process for µ-law is similar to that of A-law. There are, however, a few notable differences: 1) µ-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 8bit code. Table 3 illustrates 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 positive, and is set to 0 if the input sample is negative. µ-law Encoded Output Linear Input Data 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 A 0 0 0 0 0 1 A B 0 0 0 0 1 A B C 0 0 0 1 A B C D 0 0 1 A B C D X 0 1 A B C D X X 1 A B C D X X X A B C D X X X X B C D X X X X X C D X X X X X X D X X X X X X X X X X X X X X X S S S S S S S S 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 A A A A A A A A B B B B B B B B C C C C C C C C D D D D D D D D Table 3, µ-Law Encoding 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 µ -law encoded data is essentially a matter of reversing the steps in the encoding. Table 4 illustrates the µ-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 D bit. Young Engineering: www.young-engineering.com Page 3 of 4
  • 4. A-Law/Mu-Law Companding µ-law Encoded Input S S S S S S S S 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 A A A A A A A A B B B B B B B B C C C C C C C C Linear Output Data D D D D D D D D 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 A 0 0 0 0 0 1 A B 0 0 0 0 1 A B C 0 0 0 1 A B C D 0 0 1 A B C D 1 0 1 A B C D 1 0 1 A B C D 1 0 0 A B C D 1 0 0 0 B C D 1 0 0 0 0 C D 1 0 0 0 0 0 D 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 Table 4, µ-Law Decoding Summary There is a wide array of audio transmission systems that employ A-law and/or µ-law companding for data rate reduction with good audio quality. The compression achieved by both A-law and µ-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. Page 4 of 4 Young Engineering: www.young-engineering.com