µ-law encoder:
i. The μ-law encoder inputs 14-bit samples and outputs 8-bit codewords.
ii. The telephone signals are sampled at 8 kHz (8,000 times per second), so the μ-law encoder receives 8,000×14 = 112,000 bits/sec.
iii. At a compression factor of 1.75, the encoder outputs 64,000 bits/sec.
iv. The G.711 standard [G.711 72] also specifies output rates of 48 Kbps and 56 Kbps.
v. The μ-law encoder receives a 14-bit signed input sample x. Thus, the input is in the range [−8, 192, +8, 191].
- Logarithms are slow to compute, so the μ-law encoder performs much simpler calculations that produce an approximation. The output specified by the G.711 standard
is an 8-bit codeword whose format is shown below,
| P | S2 | S1 | S0 | Q3 | Q2 | Q1 | Q0 |
|---|----|----|----|----|----|----|----|
µ-law decoder:
The μ-law decoder inputs an 8-bit codeword and inverts it. It then decodes it as follows:
i. Multiply the quantization code by 2 and add 33 (the bias) to the result.
ii. Multiply the result by 2 raised to the power of the segment code.
iii. Decrement the result by the bias.
iv. Use bit P to determine the sign of the result.
Generation of the Codeword for -656 input samples
i. The sample is negative, so bit P becomes 1.
ii. Adding 33 to the absolute value of the input yields 689 = 00010101100012
iii. The most significant 1-bit in positions 5 through 12 is found at position 9.
iv. The segment code is thus 9 − 5 = 4.
v. The quantization code is the four bits 0101 at positions 8–5, and the remaining five bits 10001 are ignored. The 8-bit codeword (which is later inverted) becomes
P |
S2 |
S1 |
S0 |
Q3 |
Q2 |
Q1 |
Q0 |
1 |
1 |
0 |
0 |
0 |
1 |
0 |
1 |
i. The µ-law and A-law companding standards employ logarithm-based functions to encode audio samples for ISDN (Integrated Services Digital Network) digital telephony services, by means of non-linear quantization.
ii. The ISDN hardware samples the voice signal from the telephone 8kHZ and generates 14-bit samples (13 bit for A-law). The method of µ-law companding is used in North America and Japan and A-law is used elsewhere.
iii. Experiments indicate that the low amplitudes of speech signals contain more information than the high amplitudes. This is why non-linear quantization makes sense.
iv. Imagine an audio signal sent on a telephone line and digitized to 14-bit samples.
v. The louder the conversation, the higher the amplitude and the bigger value of the sample. Since high amplitudes are less important, they can be coarsely quantized.
vi. If the largest sample, which is $2^{14} -1 = 16,383$ is quantized to 255 (the largest 8-bit number) then the compression factor is 14/8 = 1.75
vii. When decoded, a code of 255 will become very different from the original 16,383.
viii. We say that because of the coarse quantization large samples end up with high quantization noise.
ix. Smaller samples should be finely quantized, so they end up with low quantization noise.
x. The µ-law encoder inputs 14-bit samples and outputs 8-bit codewords. The A-law inputs 13-bit samples and also outputs 8-bit codewords.
xi. The telephone signals are sampled at 8khz (8000 times per second) , so the µ-law encoder receives the 8000 × 14 = 1,12,000 bits/ sec.
xii. At a compression factor of 1.75 , the encoder outputs 64000 bits/sec.
µ-law / M-law Companding
i. Used in North America and Japan.
ii. It uses the fact that low amplitude of speech signals contain more information than high amplitude.
iii. Hence we can use “nonlinear quantization”.
iv. M law encoder inputs 14 bit samples and outputs 8 bit codewords.
$$\text{Figure 2.3}$$
e.g Telephone signals are sampled at 8kHz (8000 samples per second)
µ law encoder receives 8000 × 14 = 112000 bits /sec
v. Compression factor =1.75
Encoder output = 112000 / 1.75 = 64000 bits / second
vi. In general , µ law encoder receives a 14 bit signed input sample x. The input is thus in the range (-8192 , + 8192). The sample is normalized to interval (-1, +1).
vii. The encoder uses a logarithmic expression
G III standard µ = 255
Value µ increases -> Fine the quantization -> Bigger Sample -> More noise and vice versa
Mapped = sgn (x)
Where sgn (x) $= 1 x \gt 0 \\
=0 x =0 \\
= -1 x \lt 0$
viii. The output is 8 bit code and in the range [-256 , +255]
$$\text{Figure 2.4.a µ-law Midthread Quantization}$$
ix. It has 0 as one of its output levels. Used in applications when it is important that zero value is represented.
x. To be used when number of levels is odd.
xi. SNR is constant because of log expression.
A-law Companding
i. A law encoder receives a 13 bit sample input and output is 8 bit codeword.
ii. It uses the expression mapped
$= sgn (x) \ \ \ \ 0 ≤ |x| ≤ \\
= sgn (x) \ \ \ \ ≤ |x| ≤ 1 \\
A= 255 \ \ \ \ - \gt G.711 std$
$$\text{Figure 2.4.b A-Law Midriser Quantization}$$
iii. The quantizer is “ Midriser”
iv. It doesn’t have zero as one of its representation levels
v. We use midrive quantizer if number of level is even.