You are on page 1of 8
6-9-2 Digital Companding Digital companding involves compression in the transmitter after the input sample has been converted to a linear PCM code and then expansion in the receiver prior to PCM decoding. Figure 6-16 shows the block diagram for a digitally companded PCM system. With digital companding, the analog signals first sampled and converted toa linear PCM code and then the near codeis digitally compressed. In thereceiver, the compressed PCM cod is expanded and then decoded (i.e., converted back to analog). The most recent digitally com- pressed PCM systems use a 12-bit linear PCM code and an eight-bit compressed PCM code, ‘The compression and expansion curves closely resemble the analog p1-law curves: witha 1 = 255 by approximating the curve with a set of eight straight-line segments (segments 0 through), The slope ofeach successive segmentis exactly one-half that ofthe previous segment, Figure 6-17 shows the 12-bit-to-8-bit digital compression curve for positive values only. The curve for negative values is identical except the inverse. Although there are 16 segments (eight positive and eight negative), this scheme is often called 13-segment com- pression because the curve for segments +0, +1, ~O, and ~1 isa straight line with a con stant slope and is considered as one segment. The digital companding algorithm for a 12-bit linear-to-8-bit compressed code is ac- ‘wally quite simple. The eight-bit compressed code consists of a sign bit, athree-bit segment identifier, and a 10-bit magnitude code that specifies the quantization interval within the specified segment (see Figure 6-18a). In the 1255-encoding table shown in Figure 6-18b, the bit positions designated with an X are truncated during compression and subsequently lost. Bits designated A, B, C, and near Compressed An nis mae Compressed I Ce 1 1 POM tendo | “V EI | para ‘log ‘ier Sampleanc |__| Anslogto- Dial eral 0. iro rm ‘hold circu | se cote FoI am POM tranamitr| Teanaiaon wh note PAM 1, Analog Ser || Hoe | a | otal Lf Se ouput TN reat pander | paael Fe { t Linear Compressed paral paral cM PM FIGURE 6-16 Digitally companded PCM system w Relative output amplitude Segment +1 Segment +0. 1:1 no Segment +6 22:1 omerassion ratio Segment +6 16:1 compression ratio ‘Segment +4 8:1 compression ratio Segment +3 4:1 compression ratio Segment +2 2:1 compression ratio. 0 compression ‘compression Relative input amplitude FIGURE 6-17 4.255 compression characteristics (postive values only) “Segment +7 64:1 compression ratio ‘Sign bit ‘3 Bit Bit tee | segment | quantization Oa | idee |r asco coor tt | emote ritt w Tamanlson dla Encoded ke pom Transmit. Receive PCM van ean ea at compressed compressed coment Segment near code ode code code Segment 0 ‘s0000000ABCD ‘s000ABCD ‘sQO0ABCD ‘s0000000ABCO 0 1 seoomDTABCD————SOTABCD SoovAsD smo AcD 1 2 amoorascox So toancD Sor0K8CD——_somootancos 2 3 orancoxe = sottancD worTABCO ——_soMDTARCOND 3 {—— roraseoox ——SrooaseD onaseo ———_Spooraseor00 i —— tarscoooce = Storaneo Stovaseo ———_Spotaneor000 : ¢ —— faacowoox ——SttoaseD Siioasco ———_Sorapeoran00 : 9 thascowooooer —_StitaneD fiitaseo ——__staseotomo0 5 o FIGURE 6-18 12-bitto-B+it digital companding: (b) p25S encoding table; (c) u285 decoding table {e) Git y255 compressed code formset 297 298 D are transmitted as is, The sign bit is also transmitted as is. Note that for segments 0 and 1, the encoded 12-bit PCM code is duplicated exactly tthe output of the decoder (compare Figures 6-18b and c), whereas for segment 7, only the most significant six bits are dupli- cated. With 11 magnitude bits, there are 2048 possible codes, but they are not equally dis- tributed among the eight segments, There are 16 codes in segment 0 and 16 codes in seg ‘ment I. In each subsequent segment, the number of codes doubles (ie., segment 2 has 32 codes; segment 3 has 64 codes, and so on). However, in each of the eight segments, only 16 12-bit codes can be produced. Consequently, in segments 0 and 1, there is no compres- sion (ofthe 16 possible codes, all 16 can be decoded). In segment 2, there is a compression ratio of 2:1 (ofthe 32 possible codes, only 16 can be decoded). In segment 3, there isa 4:1 ‘compression ratio (64 codes to 16 codes). The compression ratio doubles with each suc- ‘cessive segment. The compression ratio in segment 7 is 1024/16, or 64:1. ‘The compression process is as follows. The analog signal is sampled and converted to linear 12-bit sign-magnitude code. The sign bit is transferred directly to an eight-it compressed code. The segment number in the eight-bit code is determined by counting the number of leading Os in the 11-bit magnitude portion of the linear code beginning with the ‘most significant bit. Subtract the number of leading Os (not to exceed 7) from 7. The result is the segment number, which is converted to a three-bit binary number and inserted ‘into the eight-bit compressed code as the segment identifier. The four magnitude bits (A, B, and D) represent the quantization interval (ie., subsegments) and are substituted into the Jeast significant four bits of the 8-bit compressed code, Essentially, segments 2 through 7 are subdivided into smaller subsegments. Each eg- iment consists of 16 subsegments, which correspond to the 16 conditions possible fr bits A,B, C, and D (0000 to 1111). In segment 2, there are two codes per subsegment. In seg- ment 3, there are four, The number of codes per subsegment doubles with each subsequent segment, Consequently, in segment 7, each subsegment has 64 codes. Figure 6-19 shows the breakdown of segments versus subsegments for segments 2, 5, and 7. Note that in each subsegment, all 12-bit codes, once compressed and expanded, yield a single 12-bit code. In the decoder, the most significant of the truncated bits is rein serted asa logic 1. The remaining truncated bits are reinserted as 0s. This ensures thatthe ‘maximum magnitude of error introduced by the compression and expansion process is mi imized, Essentially the decoder guesses what the truncated bits were prior to encoding. The ‘most logical guess is halfway between the minimum- and maximum-magnitude codes. Ft, example, in segment 6, the five least significant bits are truncated during compression; therefore in the receiver, the decoder must try to determine what those bits were. The pos sibilities include any code between 00000 and 11111. The logical guess is 10000, approxi mately half the maximum magnitude. Consequently, the maximum compression error is slightly more than one-half the maximum magnitude for that segment. Example 6-6 Determine the 12-bit linear code, the eight-bit compressed code, the decoded 12-bit code, the quant tization error, and the compression error fora resolution of 0.01 V and analog sample voltages of (@) +0,053 V, (b) -0.318 V, and (c) + 10.234 V. Solution a. To determine the 12-bit linear code, simply divide the sample voltage by the resoix tion, round off the quotient, and then convert the result to a 12-bit sign-magnitude code: SOMES = +53, which rounded off oS producing a quantization enor 0, = 0340001 V) = 0.003 V ABCD 12-bit linear code = 1 00000000101 ———_—_—_ sign bit 11-bit magnitude bits 00000000101 = $ deh Chapter 6 eunnniitt i sia sai pa ii a ote iis eel ene es ‘ai pee sais 1 as cm ; a: pie ; er @ FIGURE 6-19 12-bit segments divided into subsegments: (a) segment 7; (Continued) Todetermine the8-bit 1 9 0 0 0 0 0 0 9 10 compressed code, 1 (-7=0) ABCD sign unit ‘quantization bit identifier imerval co) (segment 0) 6) &-bit compressed code =1 ooo Gees Todetermine the 12-bit 1 oo 0 210 recovered code, simply (000 = segment) = A BOC OD reverse the process; sign segment 0 quantization bit has interval w seven leading Os (uo 12-bit recovered code = 1 OefO:20%10 0: 0-10: 014 1 1 recovered voltage = +5(0.01) = +005, 299 Segment 12-8itlinapr code ‘'2.it expanded code Subsegment sais ‘ise si asia sai ae i A, aie ‘i ae aoe ia sane ais 5 “s . p61 800101011000 5 sii oe as — Fe re pei i ‘ Mat wemgeas 8 sai oo (b) FIGURE 6-19 (Continued) (o} segment 5 ‘As Example 6-6 shows, the recovered 12-bit code (+5) is exactly the same as the original 12-bit it «ear code (+5). Therefore, the decoded voltage (+0.05 V) is the same as the original encoded voltaggh (+05). This is true forall codes in segments O and 1. Thus, there is no compression error in segment. and 1, and the only error produced is from the quantizing process (for this example, the quanias tion error Q, = 0.003 V) b, To determine the 12-bit linear code, =0318V +001 31.8, which is rounded off to ~32, producing a quantization eror Q, = -0.2 (0.01 V) ABCD 12-bit linear code = 0 00000100000 <——I1-bit magnitude bits —> 0.002 V sign bit @=-) 300 Chapter 6 on moe ne emu eapemm anne ou om ai ari pr Py pe Fi ee eee i ais = 7 aan sens ii eae an oe ai 2 Me amie si ae sone ani meee pe Fei el oe sii sae ny ah iat ae : Jan mtn sis soe 2 aestersesee PREY -s00000100001 0 iis ana o FIGURE 6-19 (Continued) (c} segment 2 To determine the 8-bit Oooo oOo 1 Dood oO compressed code, 0 (-5=2) eCD x sign unit quantization truncated bit identifier interval © (segment 2) Oy cight-bit compressed code = 0 oo a 0 d.0 Again, to determine 0 o1 9 poo the 12-bit recovered (-2=5) ABCD code, simply reverse sign segment 5 quantization the process: bit has five interval o leading 0s (0000 = 0) 2st recovered code = = $ decoded voltage = ~33(0.1) = 0.33 Digital Transmission 301 an2 Note the two inserted ones in the recovered 12-bit code. The leas significant bis detemioa from the decoding table shown in Figure 6-18c. As the figure shows, in the receiver the most signifi> cant of the truncated bits is always set 1), and all other truncated bits are cleared (0s). For segment codes, there is only one truncated bit; thus, its set in the receiver. The inserted 1 in bit positon 6 was dropped during the 12-bit-to-8-bit conversion process, as transmission of this bit is redundant because ifit were nota 1, the sample would not be in that segment. Consequently, fr all segments except sep ‘ments 0 and 1, a 1 is automatically inserted between the reinserted Os and the ABCD bits. Forthis example, there are two eros: the quantization error and the compression ero. The quantization errr is due to rounding off the sample voltage in the encoder tothe closest PCM code, and the compression error is caused by forcing the truncated bit to be a 1 inthe receives Keep in mind that the two errors are not always additive, as they could cause errors inthe oppo site direction and actually cancel each other. The worst-case scenario would be when the two ears ‘were in the same direction and at their maximum values. For this example, the combined error was 0.33 V - 0.318 V = 0.012 V. The worst possible error in segments 0 and 1 is the maximum quantization error, or half the magnitude ofthe resolution. In segments 2 through 7, the worst pss- bile error is the sum ofthe maximum quantization error plus the magnitude ofthe most significant the truncated bits ¢, To determine the 12-bit linear code, IOEREY = 410234, whichis unde off to 1023, producing a ‘quantization error Q, = -0.4(0.01 V) ABCD I2bitlinreode= 1 oO 11441449991 <1 it magnitude bits ————> sign bit a=+) To determine the 8-bit 1 (Ojiat cl 214441 compressed code, 1 ABCDXXXXX truncated 8-bit compressed code TTodetermine the 12-bit recovered code, simply 12-bit recovered code segment6 A BC D oO 1444111 0 0 0 0 +108 foAsBc DT inserted inserted decoded voltage +1008(0.01) = +1008 ‘The difference between the original 12-bit code and the decoded 12-bit code is, 10.23 ~ 10.08 = 0.15, wou itt or 1011 1111 0000 HIT = 15(0.01) = 0.15 For this example, there are again two errors: a quantization error of 0,004 V and a compression erat of 0.15 V. The combined error is 10.234 V ~ 10.08 V = 0.154 V. 6-9-3 Digital Compression Error ‘As seen in Example 6-6, the magnitude of the compression error i not the same forall same ples, Howeverthe maximum percentage ero isthe same in each segment ther than seg ‘ments O and 1, Where there is no compression error). For comparison purposes, the follow- {ng formula is used for computing the percentage error introduced by digital compression: 12-bit encoded voltage — 12-bit decoded voltage t decoded voltage % error = x 100 (6-12) Chapter 6 Digital Transmission ‘The maximum percentage error will occur for the smallest number inthe lowest subsegment within any given segment. Because there is no compression error in segments 0 and 1, for Segment 3 the ‘maximum percentage error is computed as follows: jteode 500001000000 code sQOdG1000010 ooo00000010 1000000 - 1000010, % emor = ——Tpoppig — * 100 (64 - 66, x 10 03% and for segment 7 wansmit I2-bitcode s 10000000000 receive I2-bitcode si 00001900000 00000100000 {10000000000 ~ 10000100000, 10000100000 * __|l024 ~ 1056) a % error = 100 X 100 = 3.03% AAs Example 6-7 shows, the maximum magnitude of error is higher for segment 7; however, the maximum percentage error is the same for segments 2 through 7. Conse- quently, the maximum SQR degradation is the same for each segment. Although there are several ways in which the 12-bit-to-8-bit compression and 8-bit- to-12-bit expansion can be accomplished with hardware, the simplest and most economi- ccal method is with a lookup table in ROM (read-only memory), Essentially every function performed by a PCM encoder and decoder is now accom- plished with a single integrated-circuit chip called a codec. Most of the more recently de- veloped codecs are called combo chips, as they include an antialiasing (bandpass) filter, a sample-and-hold circ digi and an analog-to- ital converter in the transmit section and a /4o-analog converter, a hold circuit, and a bandpass filter in the receive section. 303

You might also like