Digital Companding - compression happens at the transmit end after the input sample has been converted to a linear PCM code - recent digitally compressed PCM systems use a 12-bit linear code and an 8-bit compressed code - this companding process closely resembles µ = 255 analog compression curve with set a of 8 straight-line segments i. slope of each segment is half of the previous segment - the 8-bit compressed code consists of a i. sign bit ii. 3-bit segment identifier iii. 4-bit magnitude code Compression process 1. Analog signal – sampled, converted to linear 12-bit sign magnitude code 2. The sign bit in 12-bit code is transferred directly to MSB of 8-bit code 3. Segment is determined by the number of leading 0s in the 11 bit magnitude portion – subtract the number of 0s from 7 ( # of 0s <= 7) 4. This segment is converted to 3-bit binary number (segment identifier) 5. 4-bit magnitude bits which is the quantization interval is substituted to the least significant 4 bits of the 8-bit code 1 Sign bit 1 = (+) 4-bit 3-bit segment quantization identifier interval 000-111 0 = (-) abcd 0000-1111 ENCODED PCM Segment 12-bit Linear code 8-bit compressed code 0 1 2 3 4 5 6 7 S0000000abcd S0000001abcd S000001abcdx S00001abcdxx S0001abcdxxx S001abcdxxxx S01abcdxxxxx S1abcdxxxxxx s000abcd s001abcd s010abcd s011abcd s100abcd s101abcd s110abcd s111abcd Compression- ratio of possible transmit codes & possible recovered codes In each segment, only 16 12-bit codes can be recovered. Segments 2 –7 are subdivided into smaller subsegments 16 subsegment each 2 Segment 0 = 16 codes Segment 1 = 16 codes Segment 2 = 32 codes Segment 3 = 64 codes Segment 4 = 128 codes Segment 5 = 256 codes Segment 6 = 512 codes Segment 7 = 1024 codes Compression 1:1 1:1 2:1 4:1 8:1 16:1 32:1 64:1 No. codes per subsegment 1 1 2 4 8 16 32 64 DECODED PCM 8-bit compressed 12-bit Linear code code s000abcd s001abcd s010abcd s011abcd s100abcd s101abcd s110abcd s111abcd S0000000abcd S0000001abcd S000001abcd1 S00001abcd10 S0001abcd100 S001abcd1000 S01abcd10000 S1abcd100000 Segment 0 1 2 3 4 5 6 7 Note: Most significant of the truncated bits is reinserted at the decoder as 1. The remaining truncated bits are reinserted as 0s. This is to minimize the magnitude of error introduced by the compression and expansion process. 3 Percentage Error introduced by digital compression: % error = | Tx _ voltage Rx _ voltage | x 100 Rx _ voltage EXAMPLES Determine the 12-bit linear code, the 8-bit compressed code, and the recovered 12-bit code for a resolution of 0.01V and analog sample voltages of a. 0.05V b. 0.32V c. 10.23V (Answers for these problems are located at the back of the book, but you have to compute and find out how to come up with those values) For the following 12-bit linear PCM codes, determine the 8-bit compressed code to which they be converted 12-bit linear code 1000 1111 0010 0000 0100 0000 0001 1111 1000 1111 1111 0010 0000 0010 0000 A 12-bit linear sign-magnitude PCM code is digitally compressed into 8 bits. For a resolution of 0.016V determine the following quantities for the indicated input voltages: 12-bit linear PCM code, 8-bit compressed code, decoded 12-bit code, decoded voltage, and percentage error. Vin = -6.592 V, +12.992 V, and –3.36 V. 4