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

Microcontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingMicrocontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingAnkur Mahajan
 
Dsp U Lec07 Realization Of Discrete Time Systems
Dsp U   Lec07 Realization Of Discrete Time SystemsDsp U   Lec07 Realization Of Discrete Time Systems
Dsp U Lec07 Realization Of Discrete Time Systemstaha25
 
decoder and encoder
 decoder and encoder decoder and encoder
decoder and encoderUnsa Shakir
 
CS301ES: ANALOG AND DIGITAL ELECTRONICS unit-3
CS301ES: ANALOG AND DIGITAL ELECTRONICS unit-3CS301ES: ANALOG AND DIGITAL ELECTRONICS unit-3
CS301ES: ANALOG AND DIGITAL ELECTRONICS unit-3ACE ENGINEERING COLLEGE
 
Attributes of output Primitive
Attributes of output Primitive Attributes of output Primitive
Attributes of output Primitive SachiniGunawardana
 
Digital Data, Digital Signal | Scrambling Techniques
Digital Data, Digital Signal | Scrambling TechniquesDigital Data, Digital Signal | Scrambling Techniques
Digital Data, Digital Signal | Scrambling TechniquesBiplap Bhattarai
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 80869840596838
 
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)Ravikiran A
 
Information Theory and Coding
Information Theory and CodingInformation Theory and Coding
Information Theory and CodingVIT-AP University
 

What's hot (20)

program status word
program status wordprogram status word
program status word
 
Microcontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingMicrocontroller 8051 and its interfacing
Microcontroller 8051 and its interfacing
 
Dsp U Lec07 Realization Of Discrete Time Systems
Dsp U   Lec07 Realization Of Discrete Time SystemsDsp U   Lec07 Realization Of Discrete Time Systems
Dsp U Lec07 Realization Of Discrete Time Systems
 
decoder and encoder
 decoder and encoder decoder and encoder
decoder and encoder
 
Lecture13
Lecture13Lecture13
Lecture13
 
Convolutional codes
Convolutional codesConvolutional codes
Convolutional codes
 
Switches and LEDs interface to the 8051 microcontroller
Switches and LEDs interface to the 8051 microcontrollerSwitches and LEDs interface to the 8051 microcontroller
Switches and LEDs interface to the 8051 microcontroller
 
Dcs unit 2
Dcs unit 2Dcs unit 2
Dcs unit 2
 
CS301ES: ANALOG AND DIGITAL ELECTRONICS unit-3
CS301ES: ANALOG AND DIGITAL ELECTRONICS unit-3CS301ES: ANALOG AND DIGITAL ELECTRONICS unit-3
CS301ES: ANALOG AND DIGITAL ELECTRONICS unit-3
 
8155 PPI
8155 PPI8155 PPI
8155 PPI
 
Attributes of output Primitive
Attributes of output Primitive Attributes of output Primitive
Attributes of output Primitive
 
Ch 05
Ch 05Ch 05
Ch 05
 
Digital Data, Digital Signal | Scrambling Techniques
Digital Data, Digital Signal | Scrambling TechniquesDigital Data, Digital Signal | Scrambling Techniques
Digital Data, Digital Signal | Scrambling Techniques
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Active filters
Active filtersActive filters
Active filters
 
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
 
Chebyshev filter
Chebyshev filterChebyshev filter
Chebyshev filter
 
Information Theory and Coding
Information Theory and CodingInformation Theory and Coding
Information Theory and Coding
 
Chapter 03 cyclic codes
Chapter 03   cyclic codesChapter 03   cyclic codes
Chapter 03 cyclic codes
 
Logic families
Logic familiesLogic families
Logic families
 

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

Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 

Recently uploaded (20)

Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 

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