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

What's hot (20)

Amplitude modulation
Amplitude modulationAmplitude modulation
Amplitude modulation
 
1 PCM & Encoding
1  PCM & Encoding1  PCM & Encoding
1 PCM & Encoding
 
Synchronization
SynchronizationSynchronization
Synchronization
 
Line coding
Line codingLine coding
Line coding
 
Pulse code modulation
Pulse code modulationPulse code modulation
Pulse code modulation
 
Digital Data, Digital Signal | Scrambling Techniques
Digital Data, Digital Signal | Scrambling TechniquesDigital Data, Digital Signal | Scrambling Techniques
Digital Data, Digital Signal | Scrambling Techniques
 
SPEECH CODING
SPEECH CODINGSPEECH CODING
SPEECH CODING
 
Microwave linear beam 31
Microwave linear beam 31Microwave linear beam 31
Microwave linear beam 31
 
Amplitute modulation
Amplitute modulationAmplitute modulation
Amplitute modulation
 
Digital communications 1
Digital communications 1Digital communications 1
Digital communications 1
 
Turbo codes.ppt
Turbo codes.pptTurbo codes.ppt
Turbo codes.ppt
 
Frequency-Shift Keying
Frequency-Shift KeyingFrequency-Shift Keying
Frequency-Shift Keying
 
Linear block coding
Linear block codingLinear block coding
Linear block coding
 
ASK, FSK, PSK Modulation Techniques in Detail
ASK, FSK, PSK Modulation Techniques in DetailASK, FSK, PSK Modulation Techniques in Detail
ASK, FSK, PSK Modulation Techniques in Detail
 
Speech encoding techniques
Speech encoding techniquesSpeech encoding techniques
Speech encoding techniques
 
Digital to analog conversion
Digital to analog conversionDigital to analog conversion
Digital to analog conversion
 
Digital communication systems
Digital communication systemsDigital communication systems
Digital communication systems
 
PSK (PHASE SHIFT KEYING )
PSK (PHASE SHIFT KEYING )PSK (PHASE SHIFT KEYING )
PSK (PHASE SHIFT KEYING )
 
Digital modulation techniques
Digital modulation techniquesDigital modulation techniques
Digital modulation techniques
 
DPCM
DPCMDPCM
DPCM
 

Similar to A_law_and_Microlaw_companding

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

Similar to A_law_and_Microlaw_companding (20)

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

More from Akshay Sharma

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

More from Akshay Sharma (14)

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

Recently uploaded

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 

Recently uploaded (20)

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🔝
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 

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