• No results found

Source Coding: Pulse Code Modulator (PCM)

You now have a solid understanding of sampling, the first part of source coding. You also have a good understanding of quantizers, the second part of source coders. In this section we’ll put samplers and quantizers together, and throw in a third device, to build a source coder. Because there are other ways to build source coders, as we’ll see later, this source coder is given a very particular name—the pulse code modulator (PCM).

4.3.1 Introducing the PCM

You’ll probably recall that the source coder is a device that maps an analog input into a digital output. One way to build it, called the PCM, is shown in Figure 4.23 where a sam- pler is used, followed by a quantizer, which is followed by a third device called a

symbol-to-bit mapper. Here, an analog signal, which we call x(t), comes in at the input side of Figure 4.23. A sampler creates samples of this original signal, which we’ll call

x t

s

( )

; you can see this in Figure 4.23. A quantizer takes each sample that comes in and creates a new sample that comes out; this new sample has an amplitude that takes on one of N allowed levels. We’ll call this signal

x t

s

( )

, and you can see an example of it in Figure 4.23.

Finally, a device called a symbol-to-bit mapper takes in the quantized samples

( )

x t

s and, for each sample in

x t

s

( )

that comes in, it outputs a set of bits, 0’s and 1’s. A

0 may be represented by a short pulse of –5V and a 1 by a short pulse of +5V. Let me explain how this device works by example. Let’s say the quantizer outputs samples which take on one of four levels—for example, the output samples of the quantizer are values in the set {0,1,2,3}. The symbol-to-bit mapper associates a unique set of bits with each sample; for example, it associates the bits 00 with the symbol 0, it associates the bits 01 with symbol 1, ..., and it links the bits 11 with symbol 3. When a given sample comes in, it puts out the bits it has associated with that sample. It’s really quite a simple device, and you can look at Figure 4.23 to get a better feel for how it works.

To sum up, the tag-team combination of sampler, quantizer, and symbol-to-bit mapper together take an analog signal x(t)and map it to a digital signal, in this case a set of bits.

4.3.2 PCM Talk

Telecommunication engineers associate a number of terms with the pulse code modu- lator of Figure 4.23, as a way to help describe its operation. I’ll discuss three of these key words here. First, there’s sampling rate, or how many samples per second the sampler creates. As you’ll probably recall, the sampling rate is usually chosen to be at least two times the maximum frequency of the input, because if you do this, then all the information in the original signal is kept in the samples.

Next, there’s the term symbol rate. This is the number of samples per second that leave the quantizer. Since the quantizer creates one sample out for each sample that comes in, the symbol rate is also the rate of the symbols that come into the quantizer. But, if you take a quick peek at Figure 4.23, you’ll notice that the number of samples that come into the quantizer exactly matches the number of samples that come out of the sampler, so this number is always equal to the sampling rate.

x(t) t t t xs(t) xs(t) xs(t) 0 Ts 0 Ts Ts 2Ts 2Ts 2Ts 3Ts 3Ts 3Ts 0.7 0.3 1.8 2 1 0 0 1= 1 0= 1 0= 0 0= 1 2 2 0 Quantizer Symbol-to-bit mapper x(t)Sampler

Finally, there’s the bit rate. This indicates how many bits per second come out of the symbol-to-bit mapper. This number can be evaluated by the simple computation

bit rate

symbol rate

of bits

symbol

=

×

#

(4.52)

4.3.3 The “Good” PCM

Telecommunication engineers needed a way to evaluate how well a source coder, like the pulse code modulator, was working. Ultimately, they decided that a “good” source coder was one that had two things going for it. First, the amount of error in the quan- tizer part should be small; that is, they wanted a large SQNR. They called this “good” because it meant only a very little bit of information was being lost at the quantizer part. Second, the bit rate of the source coder should be small. These engineers called small bit rates “good” because they discovered that a smaller bit rate means a smaller bandwidth for the source coder output signal (shown in Figure 4.24), and that was good because a lot of communication channels would only transmit signals with a small bandwidth.

Figure 4.24 Illustrating that high bit rate leads to large signal bandwidth

... ... T1(small) in frequency domain T2 (big) in frequency domain –1/T1 1/T1 (big) –1/T2 1/T2 (small) BW 2/T1 BW 2/T1 (a)

High bit rate = many bits/sec Low bit rate = few bits/sec

... ...

However, one bright engineer saw a problem. “Wait a minute! You telecommuni- cation guys want opposite things. Your number-one want (large SQNR) and your number-two want (small bit rate) are opposites. Let’s say you want a quantizer with a high SQNR (low error). Then you’ll need a quantizer with a lot of allowed output levels, for example, 1024. But this means you’ve got to have 10 bits (

2

10

=1024

) for each symbol, which will mean a HIGH bit rate (as we see from equation (4.52)).”

He was right. Since what we want are opposite things, we have to define a “good” source coder like this:

1. If the SQNR is fixed, we get a very small bit rate (compared to other source coders); or,

2. If the bit rate is fixed, we get a very large SQNR (compared to other source coders).

All the telecommunication engineers nodded their heads in collective agreement with this notion of “good,” and so it was.

4.3.4 Source Decoder: PCM Decoder

If you’ve made it this far, it’s very likely that you understand how the source coder, the PCM, transforms an incoming analog signal into a digital one, and how to decide on a “good” PCM. Taking a look at Figure 4.25, we see what happens to the digital signal output by the PCM in the communication system: it’s transformed by a modulator, sent across the channel, and picked up by a receiver. Continuing to explore this figure, you can see the receiver hard at work: it tries to reconstruct the original signal x(t). Basi- cally, it’s the receiver’s job to undo the effects of the transmitter and the channel, as best it can. As you can see in Figure 4.25, a part of what the receiver does is undo the effects of source coding, a process suitably named source decoding, and we’ll talk here about how it works (when the source coding is PCM).

The source decoder which undoes the effects of PCM is shown in Figure 4.26. The first thing it undoes is the symbol-to-bit mapping, using a bit-to-symbol mapping, which you’ll find in Figure 4.26. This device, for each incoming set of bits, recreates the sample, with one of N possible amplitudes, that was output by the quantizer.

Figure 4.25 What happens to the PCM signal in the communication system

x(t) x(t) Quantizer Symbol-to-bit Mapper Modulator bits bits Channel

... ... Demodulator DecoderSource

PCM

Transmitter

Undoes PCM effects Receiver

The source decoder would next like to undo the effects of the quantizer, but a quick look at Figure 4.26 shows that it doesn’t do that. Let me explain what’s going on here. A quantizer, as you know, maps inputs with any amplitude, for example, 6.345, to an output with only one of N possible amplitudes. For example, for input 6.345, the output is 6. So, when a value of 6 is made available to the source decoder, it has no way of knowing exactly what input came into the quantizer. Was the input 6.001? How about 6.212? All these inputs would create an output of 6.

Looking again at Figure 4.26, you’ll see a low-pass filter (LPF), which is used to undo the effects of sampling. That’s because, as you’ll recall, and you can check back if you don’t, that the effects of the sampler are totally undone by a low-pass filtering.

So there you have it. In summary, the source decoder for PCM is made up of two parts, a piece that undoes the symbol-to-bit mapping, followed by a part that removes the sampling effects.