module 15 comp an ding wit
TRANSCRIPT
MODULE 15
COMPANDING
Prepared by: Engr. Jo-Ann C. Viñas
2
OBJECTIVES
1. Advantages and Disadvantages of Digital Communications
2. Review of Pulse Code Modulation (PCM)3. Introduce the concept of companding2. State the importance of companding3. Discuss the two types of companding4. Solve problems involving companding
3
PCM APPLICATIONS
PCM is the most commonly used technique in digital communications
1. Telephone System2. Digital Audio Recording3. CD Laser disks4. Voice mail5. Digital Video
4
ANALOG
“ANALOG means ‘similar’ or a ‘copy’.”
“An Analog audio signal is an electronic copy of an original audio signal as sound in nature, with a continually
varying signal.”
“Analog copies of any original sound suffers some degree of signal degradation, called generational loss, and signal strength lessens and noise increases for each successive
copy.”
5
DIGITAL
“A digital recording is no more than a series of numbers, and hence can be copied through an indefinite number of
generations without degradation. This implies that the life of a digital recording can be truly indefinite, because even if the medium (CD, DAT, etc) begins to decay physically,
the sample values can be copied to a new medium with no loss of information.”
6
The established sampling rates for digital audio are:
1. 32 kHz for broadcast digital audio2. 44.1 kHz for CDs3. 48 kHz for digital audiotape (DAT) and digital videotape
( mini-DV and DV)4. 96 kHz or 192. 4 kHz for DVD-audio and BD-ROM (Blu
ray disc) audio
5. 2.8224 MHz for SACD (Super Audio CD) & DSD (Direct Stream Digital)
NOTE:
7
ADVANTAGES OF DIGITAL COMMUNICATIONS
1. Digital communication is more rugged than analog communication
2. The viability of regenerative repeaters3. Digital hardware implementation is flexible4. Digital signals can be coded5. It is easier and more efficient to multiplex several
digital signals
8
REMOVAL OF NOISE AND DISTORTION FROM DIGITAL SIGNAL
TYPICAL FOUR-LEVEL SIGNAL USING 1, 2, 3, & 4V
BINARY SIGNAL
REGENERATION OF DIGITAL SIGNAL OPERATING WITH 1- AND 5V LEVELS
ANALOG SIGNAL AMPLIFIER STAGES ADD NOISE AT EACH POINT WHILE INCREASING SIGNAL AMPLITUDE, THUS REDUCING SNR
13
HARDWARE IMPLEMENTATION IS FLEXIBLE
0 TO +1V ANALOG SIGNAL
2 BITS RESOLUTION
3 BITS RESOLUTION
17
DISADVANTAGE OF DIGITAL COMMUNICATIONS
1. Increased bandwidth of transmission
18
ADVANTAGES OF DIGITAL COMMUNICATIONS
Audio compression is typically used for 3 reasons:
1. To reduce the file size so that more audio may be stored on a given media format (digital audio players, DVD-video disc, Minidisc. Etc)2. To reduce the file size so that files will download from a Web site faster.3. To reduce the data rate so that files will stream (broadcast) over a network such as the Internet.
19
CRITERIA FOR SIGNAL ENCODING
What determines how successful a receiver will be in interpreting an incoming signal?
1. Signal-to-Noise Ratio2. Data Rate3. Bandwidth
An increase in data rate increases bit error rate
An increase in SNR decreases bit error rateAn increase in bandwidth allows an increase in data rate
20
PULSE CODE MODULATION
- is a method of modulating in which a continuous analog wave is transmitted in an equivalent digital mode.
21
NOTE:
“If a band-limited signal is sampled at regular intervals of time and a a rate equal to or higher than twice the highest significant signal frequency, then the sample contains all the information of the original signal. The original signal may then be reconstructed by use of a low-pass filter.”
PCM TRANSMIT BLOCKS
SAMPLINGSAMPLING QUANTIZINGQUANTIZING ENCODINGENCODING
23
QUANTIZATION
Changing from CONTINUOUS IN VALUE to DISCRETE IN VALUE.
24
SAMPLING
Changing from CONTINUOUS IN TIME to DISCRETE IN TIME.
25
CODING
Code value of sample into 1s and 0s.
PCM PARAMETERS
1. Number of Levels or Codewords (M)2. Bandwidth (Data Rate) (BW)3. Dynamic Range (DR)4. Resolution (Res)5. Coding Efficiency ()6. Quantization Error (Qe)7. Signal-to-Quantization Noise Ratio (SQR)
27
1. Number of Levels or Codewords (M)
PCM PARAMETERS
M = 2n
where:M = # of levels, symbols or codewordsn = # of PCM bits used (sign bit excluded) = # of bits per sample
28
2. Bandwidth (Data Rate)
PCM PARAMETERS
BW = nfs = fb
where:fs = sampling rate in Hzfb = bit rate in bps
29
3. Dynamic Range
PCM PARAMETERS
DR = 2n - 1 DR = Vmax
Vmin
where:Vmax = maximum input voltageVmin = minimum input voltage
DYNAMIC RANGE OF ANALOG SIGNAL
31
EXAMPLE
What is the dynamic range of an 8-bit linear sign magnitude PCM spectrum whose maximum decode voltage at the receiver is 1.27 Vp? (ECE BOARD EXAM NOV 2002)
32
4. Resolution
PCM PARAMETERS
Resolution = VLSB
where:VLSB = voltage of the least significant bit
33
EXAMPLE
Determine the resolution for an 8-bit linear sign-magnitude PCM for a maximum decode voltage of 2.55Vp. (ECE BOARD EXAM NOV 2002)
34
5. Coding Efficiency ()
PCM PARAMETERS
=min
max
X 100
where:min = Min # of bits (including the sign bit)max= Actual # of bits (including the sign bit)
35
6. Quantization Error
PCM PARAMETERS
Qe =VMIN
2 Qe =
Resolution
2
36
7. Signal-to-Quantization Noise Ratio
PCM PARAMETERS
SQR = 10.79 dB + 20 log VS
q
37
A. Ideal Signal-to-Quantization Noise Ratio
PCM PARAMETERS
= 3M2SN
SN
32= (22n)
a. In unitless
b. In dB
= 6.02n + 1.76SN dB
MOSTUSED...
38
EXAMPLE
Determine the signal-to-quantization noise ratio in dB, if an audio signal with a bandwidth of 3.2 kHz is converted to PCM signal by sampling at 8 kilo samples/sec and with a data rate of 64 kbps.
39
CODING
- Practical PCM systems use 7- and 8-level binary code, or
27 = 128 quantum steps28 = 256 quantum steps
LINEAR QUANTIZATION - SIGNAL AMPLITUDE VERSUS QUANTIZATION VALUE
41
NOTE:
- Two methods are used to reduce the quantum steps to 128 or 256 without sacrificing fidelity.
1. Use nonuniform quantizing performed in the coding process.
2. Use companding prior to quantizing
LINEAR VERSUS NON LINEAR PCM CODES
NON-LINEAR STEP QUANTIZING
44
COMPANDING
- the process of compressing and then expanding
- with companded system, the higher amplitude analog signals are compressed (amplified less than the lower- amplitude signals) prior to transmission and then expanded) amplified more than the lower amplitude signals in the receiver).
BASIC COMPANDING PROCESS
46
2 TYPES OF COMPANDING
1. Analog Compandinga. - Lawb. A - Law
2. Digital Companding
PCM SYSTEM WITH ANALOG COMPANDING
48
2 TYPES OF COMPANDING
A - Law - Law
- originally defined by the Comite European de Postes et Telecommunications (CEPT)
- defined by the T1 Standards Committee in the USA
- is probably the most wide spread internationally
- is dominant in the world’s largest system in North America
“Both are recognized by the telephony section of the International Telecommunication Union (ITU-T), the supreme international standards organization for telephony.”
- A-law produces slightly better SNR for small signals
- while the µ-law has less noise on an idle channel
“Both characteristics allow small signals to be processed as accurately as large signals, and produce much improved signal to noise ratio SNR.”
49
µ-LAW COMPANDING
Vout = Vmax ln(1 + µ{Vin /Vmax})
ln(1 + µ)
Where: Vmax = maximum uncompressed analog input amplitude (volts)Vin = amplitude of the input signal at particular instant of time (volts)µ = parameter used to define the amount of compression(unitless)Vout = compressed output amplitude (volts)
µ-LAW CHARACTERISTIC
51
EXAMPLE
For a compressor with a µ = 255, determine:
a) The voltage gain for the following relative values of Vin shown in the table below:
52
EXAMPLE
b) The compressed output voltage for a maximum input voltage of 4V.
c) Input and output dynamic ranges and compression in dB.
53
µ-LAW CHARACTERISTIC
Where:V = Output VoltageVr = Reference Voltagec = Chord Numbers = Step Number
54
A-LAW COMPANDING
In Europe, the ITU-T has established A-law companding to be used to approximate true logarithmic companding
Vout = AVin /Vmax
1 + lnAVmax
1 + ln(AVin /Vmax)
1 + lnAVout =
0 ≤
Vin
Vmax
Vmax
≤
1 A
1 A
≤
Vin
Vmax
≤
1
DIGITALLY COMPOUNDED PCM SYSTEM
µ-255 COMPRESSION CHARACTERISTIC
- µ-law companding is a system that divides the analog signal range into fifteen segments each eventually encoded into eight-bit digital value.
13 SEGMENT SCALE
µ-255 COMPRESSION CHARACTERISTIC
PCM QUANTIZATION LEVELS - CHORDS & STEPS
QUANTIZATION ERROR - RECOVERED STEP LEVELS DO NOT MATCH PAM LEVELS
LINEAR QUANTIZATION - ANOTHER VIEW
LOGARITHMIC QUANTIZATION - ANOTHER VIEW
63
8-BIT COMPRESSED CODE FORMAT
64
µ-255 ENCODING TABLE
65
µ-255 DECODING TABLE
66
67
PROCESS OF DIGITAL COMPRESSION
Digitally, the 12-bit values are encoded into 8-bit compressed code as follows:
1. Retain the sign bit as the first bit of the 8-bit code.
2. Count the number of zeros until the occurrence of the first 1 bit. Subtract the zero count from 7. This is the segment number.
3. The first occurrence of 1 is assumed during the expanding process, so it is set aside during compression.4. Copy the next four bits (ABCD) into the 8-bit compressed code.
68
EXAMPLE
Code the 12-bit code 100001011010 into an 8-bit compressed µ-law code.
69
EXAMPLE
Determine the 12-bit linear code, the eight-bit compressed code, the decoded 12-bit code, the quantization error, and the compression error for a resolution of 0.01 V and analog sample voltages of
(a) + 0.053 V(b) -0.318 V (c) +10.234 V
70
PROCESS OF DIGITAL EXPANSION
Expanding back digitally, reverses the process:
1. Retain the sign bit.2. Take the segment number, subtract from 7 and add
that many 0s.3. Make the next bit a 1.4. The next bits are ABCD values.5. Add a 1 and sufficient 0s to complete the 12-bit value.
71
QUANTIZATION ERROR
- error is error due to rounding off the sample voltage in the encoder to the closest PCM.
72
COMPRESSION ERROR
- error caused by forcing the truncated bit to a 1 in the receiver.
73
DIGITAL COMPRESSION ERROR
The magnitude of the compression error is not the same for all samples. However, the maximum percentage is the same in each segment (other than segments 0 and 1, where there is no compression error)
% error =12-bit encoded voltage - 12-bit decoded voltage
12-bit decoded voltage X 100
74
CODEC
A single integrated chip that performs the encoding and decoding process of PCM.
75
EXAMPLE
Expand the compressed code of the above example.
76
SEATWORK
For the following values of μ, Vmax, and Vin, determine the compressor gain:
77
SEATWORK
For the following 12-bit linear PCM codes, determine the eight-bit compressed code to which they would be converted:
a. 100011110010b. 000001000000c. 000111111000d. 111111110010e. 000000100000
78
SEATWORK
For the following 8-bit compressed codes,determine the expanded 12-bit code.
a. 11001010b. 00010010c. 10101010d. 01010101e. 11110000f. 11011011
79
SEATWORK
A 12-bit linear sign-magnitude PCM code is digitally compressed into 8 bits. For a resolution of 0.016 V, determine the following quantities for the indicated input voltages: a. 12-bit linear PCM code
b. eight-bit compressed code c. decoded 12-bit code
d. decoded voltage
For Vin = -6.592 V, +12.992 V, -3.36 V