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

DSP_FOEHU - Lec 11 - IIR Filter Design
DSP_FOEHU - Lec 11 - IIR Filter DesignDSP_FOEHU - Lec 11 - IIR Filter Design
DSP_FOEHU - Lec 11 - IIR Filter DesignAmr E. Mohamed
 
FM demodulation using PLL
FM demodulation using PLLFM demodulation using PLL
FM demodulation using PLLmpsrekha83
 
Coherent and Non-coherent detection of ASK, FSK AND QASK
Coherent and Non-coherent detection of ASK, FSK AND QASKCoherent and Non-coherent detection of ASK, FSK AND QASK
Coherent and Non-coherent detection of ASK, FSK AND QASKnaimish12
 
Companding & Pulse Code Modulation
Companding & Pulse Code ModulationCompanding & Pulse Code Modulation
Companding & Pulse Code ModulationYeshudas Muttu
 
Discrete-Time Signal Processing
Discrete-Time Signal ProcessingDiscrete-Time Signal Processing
Discrete-Time Signal Processinglancer350
 
Delta modulation
Delta modulationDelta modulation
Delta modulationmpsrekha83
 
PULSE CODE MODULATION (PCM)
PULSE CODE MODULATION (PCM)PULSE CODE MODULATION (PCM)
PULSE CODE MODULATION (PCM)vishnudharan11
 
Presentation
PresentationPresentation
PresentationVirak Sou
 
Memory & I/O interfacing
Memory & I/O  interfacingMemory & I/O  interfacing
Memory & I/O interfacingdeval patel
 
Pulse Modulation ppt
Pulse Modulation pptPulse Modulation ppt
Pulse Modulation pptsanjeev2419
 
Unit II Arm7 Thumb Instruction
Unit II Arm7 Thumb InstructionUnit II Arm7 Thumb Instruction
Unit II Arm7 Thumb InstructionDr. Pankaj Zope
 
Digital Modulation Unit 3
Digital Modulation Unit 3Digital Modulation Unit 3
Digital Modulation Unit 3Anil Nigam
 

What's hot (20)

DSP_FOEHU - Lec 11 - IIR Filter Design
DSP_FOEHU - Lec 11 - IIR Filter DesignDSP_FOEHU - Lec 11 - IIR Filter Design
DSP_FOEHU - Lec 11 - IIR Filter Design
 
Source coding theorem
Source coding theoremSource coding theorem
Source coding theorem
 
Matched filter
Matched filterMatched filter
Matched filter
 
FM demodulation using PLL
FM demodulation using PLLFM demodulation using PLL
FM demodulation using PLL
 
Ditial to Analog Converter
Ditial to Analog ConverterDitial to Analog Converter
Ditial to Analog Converter
 
Coherent and Non-coherent detection of ASK, FSK AND QASK
Coherent and Non-coherent detection of ASK, FSK AND QASKCoherent and Non-coherent detection of ASK, FSK AND QASK
Coherent and Non-coherent detection of ASK, FSK AND QASK
 
Interfacing LCD with 8051 Microcontroller
Interfacing LCD with 8051 MicrocontrollerInterfacing LCD with 8051 Microcontroller
Interfacing LCD with 8051 Microcontroller
 
Companding & Pulse Code Modulation
Companding & Pulse Code ModulationCompanding & Pulse Code Modulation
Companding & Pulse Code Modulation
 
Discrete-Time Signal Processing
Discrete-Time Signal ProcessingDiscrete-Time Signal Processing
Discrete-Time Signal Processing
 
Delta modulation
Delta modulationDelta modulation
Delta modulation
 
PULSE CODE MODULATION (PCM)
PULSE CODE MODULATION (PCM)PULSE CODE MODULATION (PCM)
PULSE CODE MODULATION (PCM)
 
Turbo codes.ppt
Turbo codes.pptTurbo codes.ppt
Turbo codes.ppt
 
Presentation
PresentationPresentation
Presentation
 
Pulse shaping
Pulse shapingPulse shaping
Pulse shaping
 
Dcs unit 2
Dcs unit 2Dcs unit 2
Dcs unit 2
 
Memory & I/O interfacing
Memory & I/O  interfacingMemory & I/O  interfacing
Memory & I/O interfacing
 
Pulse Modulation ppt
Pulse Modulation pptPulse Modulation ppt
Pulse Modulation ppt
 
DPCM
DPCMDPCM
DPCM
 
Unit II Arm7 Thumb Instruction
Unit II Arm7 Thumb InstructionUnit II Arm7 Thumb Instruction
Unit II Arm7 Thumb Instruction
 
Digital Modulation Unit 3
Digital Modulation Unit 3Digital Modulation Unit 3
Digital Modulation Unit 3
 

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

Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 

Recently uploaded (20)

Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 

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