MODULE 15
COMPANDING
Prepared by: Engr. Jo-Ann C. Viña
OBJECTIVES
1. Ad Adv van anta tag ges and and Di Disa sadv dvan anta tage ges s of of Dig Digit ital al Communications 2. Re Revi view ew of Pul Pulse se Co Code de Mo Modu dula lati tion on (P (PCM CM)) 3. In Intr trod oduc uce e the the co conc ncep eptt of of co comp mpan and din ing g 2. St Stat ate e th the e im imp por orta tanc nce e of co comp mpan andi ding ng 3. Disc Di scus uss s th the e tw two o ty type pes s of co comp mpan and din ing g 4. So Solv lve e pro probl blem ems s inv invol olv vin ing g com compa pand ndin ing g
PCM APPLICATIONS
PCM is the most commonly used technique in digital communications 1. 2. 3. 4. 5.
Telephone System Digit ita al Audio Rec eco ord rdiing CD Laser disks Voice mail Digital Video
ANALOG
“ANALOG means ‘similar ‘similar ’ or a ‘copy ‘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.”
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. 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.”
NOTE:
The established sampling rates for digital audio are: 1. 2. 3. 4. 5.
32 kHz kHz fo forr bro broad adc cast di digi gita tall aud audio io 44.1 kHz for CDs 48 kH kHz z for for dig digit ital al au audi diot otap ape e (DA (DAT) T) an and d dig digita itall vid video eota tape pe ( mini-DV and DV) 96 kH kHz z or 19 192. 2. 4 kHz kHz fo forr DVD DVD-a -aud udio io an and d BDBD-RO ROM M (Blu (Blu ray disc) disc) audio 2.8224 2.82 24 MH MHz z for for SA SACD CD (S (Sup uper er Au Audi dio o CD) CD) & DSD DSD (D (Dir irec ectt Stream Digital)
ADVANTAGES OF DIGITAL COMMUNICATIONS
1. Dig igit ital al co com mmun unic icat atiion is more rugged than analog communication 2. The viability of f regenerative regenerative repeaters 3. Digi Di gita tall ha hard rdwa ware re im impl plem emen enta tati tion on is flexible 4. Digital signals can be coded 5. It is easier and more efficient to multiplex several digital signals
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
HARDWARE IMPLEMENTATION IS FLEXIBLE
0 TO +1V ANALOG SIGNAL
2 BITS RESOLUTION
3 BITS RESOLUTION
DISADVANTAGE OF DIGITAL COMMUNICATIONS
1.
Incr In crea ease sed d ba band ndwi widt dth h of tr tran ansm smis issi sion on
ADVANTAGES OF DIGITAL COMMUNICATIONS
Audio compression is typically used for 3 reasons: 1. To re redu duce ce th the e fil file e siz size e so so tha thatt mor more e aud audio io ma may y be be stored on a given media format (digital audio players, DVDvideo disc, Minidisc. Etc) 2. To re redu duce ce the the fil file e size size so so tha thatt file files s will will do downl wnloa oad d fro from ma Web site faster. 3. To redu reduc ce the the dat data rat rate so th that fi files wi will stre strea am (broadcast) over a network such as the Internet.
CRITERIA FOR SIGNAL ENCODING
What determines how successful a receiver will be in interpreting an incoming signal? 1. 2. 3.
Signal-to-Noise Ratio Data Rate Bandwidth An increase in data rate increases bit error rate An increase in SNR decreases bit error rate An increase in bandwidth allows an increase in data rate
PULSE CODE MODULATION
is a method of of mo modulating in in wh which a continuous analog wave is transmitted in an equivalent digital mode.
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
SAMPLING SAMPLING
QUANTIZING QUANTIZING
ENCODING ENCODING
QUANTIZATION
Changing from CONTINUOUS IN VALUE to DISCRETE IN VALUE .
SAMPLING
Changing from CONTINUOUS IN TIME to DISCRETE IN TIME .
CODING
Code value of sample into 1s and 0s.
PCM PARAMETERS
1. 2. 3. 4. 5. 6. 7.
Number of Levels or Codewords (M) Bandwidth (Data Rate) (BW) Dynamic Range (DR) Resolution (Res) Coding Efficiency (η ) Quantization Error (Qe) (Qe) Signal-to-Quantization Noise Ratio (SQR)
PCM PARAMETERS
1.
Num umb ber of Lev evel els s or Co Code dewo word rds s (M)
M = 2n
where: M = # of levels, symbols or codewords n = # of PCM bits used (sign bit excluded) = # of bits per sample
PCM PARAMETERS
2.
Bandwidth (Data Rate)
BW = nf s = f b
where: f s = sampling rate in Hz f b = bit rate in bps
PCM PARAMETERS
3.
Dynamic Range
DR = 2n - 1
where: Vmax = maximum input voltage Vmin = minimum input voltage
Vmax DR = Vmin
DYNAMIC RANGE OF ANALOG SIGNAL
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 V p? (ECE BOARD EXAM NOV 2002)
PCM PARAMETERS
4.
Resolution
Resolution = VLSB
where: VLSB = voltage of the least le ast significant bit
EXAMPLE
Determine the resolution for an 8-bit linear sign-magnitude PCM for a maximum decode voltage of 2.55V p. (ECE BOARD EXAM NOV 2002)
PCM PARAMETERS
5.
Coding Efficiency (
β η = β
)
min max
where: β min = Min # of bits (including the sign bit) β max= Actual # of bits (including ( including the sign bit)
X 100
PCM PARAMETERS
6.
Quantization Error
Qe =
VMIN 2
Resolution Qe = 2
PCM PARAMETERS
7.
Sign Si gnal al-t -too-Qu Quan anti tiza zati tion on No Nois ise e Rat Ratio io
V SQR = 10.79 dB + 20 logS q
PCM PARAMETERS
A.
Idea Id eall Sign Signal al-t -too-Qu Quan anti tiza zati tion on Noi Noise se Rat Ratio io
a. In unitless
S = 3M2 N
S 3 2n = (2 ) N 2
b. In dB
S N
dB
= 6.02n + 1.76
MOST USED...
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.
CODING
- Practical PCM systems use 7- and 8-level binary code, 27 = 128 quantum steps 28 = 256 quantum steps
or
LINEAR QUANTIZATION - SIGNAL AMPLITUDE VERSUS QUANTIZATION VALUE
NOTE:
-Two methods are used to reduce the quantum steps to 128 or 256 without sacrificing fidelity. 1. Use nonuniform quantizing performed in the process. 2. Use companding prior to quantizing
coding
LINEAR VERSUS NON LINEAR PCM CODES
NON-LINEAR STEP QUANTIZING
COMPANDING
-
the th e pr process of of co compressing an and the then n ex expandin ing g with co with comp mpa and nded ed sy sys ste tem, m, th the e hig highe herr amp ampli litu tude de an ana alo log g signals are compressed (amplified less than the loweramplitude signals) prior to transmission and then expanded) amplified more than the lower amplitude signals in the receiver).
BASIC COMPANDING PROCESS
2 TYPES OF COMPANDING
1. a. b.
Analog Companding - Law A - Law
2.
Digital Companding
PCM SYSTEM WITH ANALOG COMPANDING
2 TYPES OF COMPANDING
A - Law ginally defined by the Comite -European defined by the defined Postes et Telecommunicationsthe (CEPT USA )
- Law T1
Standards Committe
re recognized by the telephony section of the International Telecomm ITU-T), the supreme international standards organization for telephon - is probably the most wide spread - is dominant in the world’s w orld’s largest syst internationally in North America cteristics allow small signals to be processed as accurately as large si produce much improved signal to noise ratio SNR.” -law produces slightly better SNR - while for the µ-law has less noise on an id mall signals channel chann el
µ-LAW COMPANDING
Vmax ln(1 + µ{Vin /Vmax }) Vout = 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
EXAMPLE For a compressor with a µ = 255, determine: a) Th The e volt voltag age e gain gain for for the the fol follo lowi wing ng rel relat ativ ive e valu values es of of Vin shown in the table below:
EXAMPLE
b)
c)
The compressed output voltage for a maximum input voltage of 4V. Input and output dynamic ranges and compression in dB.
µ-LAW CHARACTERIST CHARACTERISTIC IC
Where: V = Output Voltage Vr = Reference Voltage c = Chord Number s = Step Number
A-LAW COMPANDING
In Europe, the ITU-T has established A-law companding to be used to approximate true logarithmic companding
Vout = Vmax
Vout = Vmax
AVin /Vmax
Vin
0≤
Vmax
1 + lnA 1 + ln(AVin /Vmax )
1
1 + lnA
A
≤
1 ≤ Vin Vmax
A ≤ 1
DIGITALLY COMPOUNDED PCM SYSTEM
µ-255 COMPRESSION CHARACTERISTIC CHARACTERISTIC µ-l -law aw co com mpand ndin ing g is is a sy syst stem em th tha at di divid ide es th the an analog signal range into fifteen segments each eventuall eventually y encoded into eight-bit digital value.
13 SEGMENT SCALE
µ-255 COMPRESSION CHARACTERISTIC CHARACTERISTIC
PCM QUANTIZATION LEVELS - CHORDS & STEPS
QUANTIZATION ERROR - RECOVERED STEP LEVELS DO NOT MATCH PAM LEVELS
LINEAR QUANTIZATION - ANOTHER VIEW
LOGARITHMIC QUANTIZATION - ANOTHER VIEW
8-BIT COMPRESSED CODE FORMAT
µ-255 ENCODING TABLE
µ-255 DECODING TABLE
PROCESS OF DIGITAL COMPRESSION
Digitally, the 12-bit values compressed code as follows: 1.
are
encoded
into
8-bit
Reta Re tain in th the e sig sign n bit bit as th the e fir first st bi bitt of of the the 88-bi bitt cod code. e.
2. Co Coun untt the the num numbe berr of of zero zeros s unt until il th the e occ occur urre rence nce of th the e fir first st 1 bit bit.. Subtract the zero count from 7. This is the segment number. 3. Th The e firs firstt occ occur urre renc nce e of of 1 is is assu assume med d dur durin ing g the the exp expan andi ding ng process, so it is set aside during compression. 4. Co Copy py th the e ne next xt fo four ur bi bits ts (A (ABC BCD) D) in into to th the e 88-bi bitt co comp mpre resse ssed d co code de..
EXAMPLE
Code the 12-bit code compressed µ-law code.
100001011010
into
an
8-bit
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
PROCESS OF DIGITAL EXPANSION
Expanding back digitally, reverses the process: 1. Retain the sign bit. 2. Ta Take ke th the e seg segme ment nt nu numb mber er,, sub subtr trac actt fro from m 7 an and d add add that many 0s. 3. Make the next bit a 1. 4. The next bit its s ar are e ABCD val alu ues es.. 5. Ad Add d a 1 an and d suf suffi fici cien entt 0s 0s to co comp mple lete te the the 1212-bi bitt val value ue..
QUANTIZATION ERROR
-error is error due to rounding off the sample voltage in the encoder to the closest PCM.
COMPRESSION COMPRESSIO N ERROR
-error caused by forcing the truncated bit to a 1 in the receiver.
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)
12-bit encoded voltage - 12-bit decoded voltage
% error =
X 100
12-bit decoded voltage
CODEC
A single integrated chip that performs the encoding and decoding process of PCM.
EXAMPLE
Expand the compressed code of the above example.
SEATWORK
For the following values of μ, Vmax, and Vin, determine the compressor gain:
SEATWORK
For the following 12-bit linear PCM codes, determine the eight-bit compressed code to which they would be converted: a. b. c. d. e.
100011110010 000001000000 000111111000 111111110010 000000100000
SEATWORK
For the following 8-bit compressed codes,determine the expanded 12-bit code. a. b. c. d. e. f.
11001010 00010010 10101010 01010101 11110000 11011011
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-b -biit co compressed co code c. decoded 12-bit code d. decoded voltage For Vin = -6.592 V, +12.992 V, -3.36 V