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

Performance Analysis Of Different Digital Modulation Scheme
Performance Analysis Of Different Digital Modulation SchemePerformance Analysis Of Different Digital Modulation Scheme
Performance Analysis Of Different Digital Modulation SchemeAjay Walia
 
Pulse code modulation
Pulse code modulationPulse code modulation
Pulse code modulationNaveen Sihag
 
Amplitude modulation & demodulation
Amplitude modulation & demodulation Amplitude modulation & demodulation
Amplitude modulation & demodulation Bikz013
 
Quadrature amplitude modulation qam transmitter
Quadrature amplitude modulation qam transmitterQuadrature amplitude modulation qam transmitter
Quadrature amplitude modulation qam transmitterAsaad Drake
 
Demodulation of AM wave
Demodulation of AM waveDemodulation of AM wave
Demodulation of AM waveLokesh Parihar
 
Structures for FIR systems
Structures for FIR systemsStructures for FIR systems
Structures for FIR systemsChandan Taluja
 
Pulse modulation
Pulse modulationPulse modulation
Pulse modulationstk_gpg
 
Phase Shift Keying & π/4 -Quadrature Phase Shift Keying
Phase Shift Keying & π/4 -Quadrature Phase Shift KeyingPhase Shift Keying & π/4 -Quadrature Phase Shift Keying
Phase Shift Keying & π/4 -Quadrature Phase Shift KeyingNaveen Jakhar, I.T.S
 
Super heterodyne receiver
Super heterodyne receiverSuper heterodyne receiver
Super heterodyne receivermpsrekha83
 
Electrical Wire Model
Electrical Wire ModelElectrical Wire Model
Electrical Wire ModelVARUN KUMAR
 
Line coding presentation
Line coding presentationLine coding presentation
Line coding presentationDibyendu Porey
 
M ary psk modulation
M ary psk modulationM ary psk modulation
M ary psk modulationAhmed Diaa
 
7.instrumentation amplifier
7.instrumentation amplifier7.instrumentation amplifier
7.instrumentation amplifierINDIAN NAVY
 

What's hot (20)

Digital communication unit II
Digital communication unit IIDigital communication unit II
Digital communication unit II
 
Performance Analysis Of Different Digital Modulation Scheme
Performance Analysis Of Different Digital Modulation SchemePerformance Analysis Of Different Digital Modulation Scheme
Performance Analysis Of Different Digital Modulation Scheme
 
Pulse code modulation
Pulse code modulationPulse code modulation
Pulse code modulation
 
Pulse Code Modulation.pptx
Pulse Code Modulation.pptxPulse Code Modulation.pptx
Pulse Code Modulation.pptx
 
ASk,FSK,PSK
ASk,FSK,PSKASk,FSK,PSK
ASk,FSK,PSK
 
Amplitude modulation & demodulation
Amplitude modulation & demodulation Amplitude modulation & demodulation
Amplitude modulation & demodulation
 
Matched filter
Matched filterMatched filter
Matched filter
 
Quadrature amplitude modulation qam transmitter
Quadrature amplitude modulation qam transmitterQuadrature amplitude modulation qam transmitter
Quadrature amplitude modulation qam transmitter
 
Speech encoding techniques
Speech encoding techniquesSpeech encoding techniques
Speech encoding techniques
 
Demodulation of AM wave
Demodulation of AM waveDemodulation of AM wave
Demodulation of AM wave
 
Structures for FIR systems
Structures for FIR systemsStructures for FIR systems
Structures for FIR systems
 
Pulse modulation
Pulse modulationPulse modulation
Pulse modulation
 
Phase Shift Keying & π/4 -Quadrature Phase Shift Keying
Phase Shift Keying & π/4 -Quadrature Phase Shift KeyingPhase Shift Keying & π/4 -Quadrature Phase Shift Keying
Phase Shift Keying & π/4 -Quadrature Phase Shift Keying
 
Super heterodyne receiver
Super heterodyne receiverSuper heterodyne receiver
Super heterodyne receiver
 
Line coding
Line codingLine coding
Line coding
 
Serial transmission
Serial transmissionSerial transmission
Serial transmission
 
Electrical Wire Model
Electrical Wire ModelElectrical Wire Model
Electrical Wire Model
 
Line coding presentation
Line coding presentationLine coding presentation
Line coding presentation
 
M ary psk modulation
M ary psk modulationM ary psk modulation
M ary psk modulation
 
7.instrumentation amplifier
7.instrumentation amplifier7.instrumentation amplifier
7.instrumentation amplifier
 

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

DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
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
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
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
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
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
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
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
 
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
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
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
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
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
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
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
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 

Recently uploaded (20)

DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
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
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
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
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.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
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
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
 
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
 
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
 
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
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
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
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
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
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 

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