You are on page 1of 4

PCM - ENCODING

modules
basic: none
advanced: PCM ENCODER
optional advanced: WIDEBAND TRUE RMS METER

preparation
The purpose of this experiment is to introduce the PCM ENCODER module. This module
generates a pulse code modulated - PCM - output signal from an analog input message.
Please refer to the TIMS Advanced Modules User Manual for complete details of the
operation of this module.
In this experiment the module will be used in isolation; that is, it will not be part of a larger
system. The formatting of a PCM signal will be examined in the time domain.
The Lab Sheet, entitled PCM - decoding, will illustrate the recovery of the analog message
from the digital signal.

PCM encoding
The input to the PCM ENCODER module is an analog message. This must be constrained
to a defined bandwidth and amplitude range.
The maximum allowable message bandwidth will depend upon the sampling rate to be used.
The Nyquist criterion must be observed.
The message amplitude must be held within the range of the TIMS ANALOG REFERENCE
LEVEL of ±2 volts peak. This is in keeping with the input amplitude limits set for all analog
modules.
A step-by-step description of the operation of the module follows:

1. the module is driven by an external TTL clock.


2. the input analog message is sampled periodically. The sample rate is a sub-multiple of
the external clock.
3. the sampling is a sample-and-hold operation. It is internal to the module, and cannot be
viewed by the user 1. What is held is the amplitude of the analog message at the
sampling instant.
4. each sample amplitude is compared with a finite set of amplitude levels. These are
distributed (uniformly, for linear sampling) within the TIMS ANALOG REFERENCE
LEVEL. These are the system quantizing levels.

1 the sample and hold operation is examined separately in the Lab Sheet entitled Sampling with SAMPLE & HOLD.

www.emona-tims.com 1/4
Emona-TIMS PCM - encoding L-24 rev 1.3

5. each quantizing level is assigned a number, starting from zero for the lowest (most
negative) level, with the highest number being (L-1), where L is the available number
of levels.
6. each sample is assigned a digital (binary) code word representing the number
associated with the quantizing level which is closest to the sample amplitude. The
number of bits ‘n’ in the digital code word will depend upon the number of quantizing
levels. In fact, n = log2(L).
7. the code word is assembled into a time frame together with other bits as may be
required (described below). In the TIMS PCM ENCODER (and many commercial
systems) a single extra bit is added, in the least significant bit position. This is
alternately a one or a zero. These bits are used by subsequent decoders for frame
synchronization.
8. the frames are transmitted serially. They are transmitted at the same rate as the samples
are taken. The serial bit stream appears at the output of the module.
9. also available from the module is a synchronizing signal FS (‘frame synch’). This
signals the end of each data frame.

the TIMS PCM time frame


Each binary word is located in a time frame. The time frame contains eight slots of equal
length, and is eight clock periods long. The slots, from first to last, are numbered 7 through
0. These slots contain the bits of a binary word. The least significant bit (LSB) is contained
in slot 0.
The LSB consists of alternating ones and zeros. These are placed (‘embedded’) in the frame
by the encoder itself, and cannot be modified by the user. They are used by subsequent
decoders to determine the location of each frame in the data stream, and its length. See the
Lab Sheet entitled PCM - decoding.
The remaining seven slots are available for the bits of the binary code word. Thus the
system is capable of a resolution of seven-bits maximum. This resolution, for purposes of
experiment, can be reduced to four bits (by front panel switch). The 4-bit mode uses only
five of the available eight slots - one for the embedded frame synchronization bits, and the
remaining four for the binary code word (in slots 4, 3, 2, and 1).
The only module required for this experiment is a TIMS PCM ENCODER.
Operation as a single channel PCM encoder is examined in this experiment. Operation as
part of a two-channel PCM-TDM system will not be investigated here. See the Lab Sheet
entitled PCM - TDM.

experiment
1. select the TIMS companding A4-law with the on-board COMP jumper (in preparation
for a later part of the experiment).
2. locate the on-board switch SW2. Put the LEFT HAND toggle DOWN and the RIGHT
HAND toggle UP. This sets the frequency of a message from the module at SYNC.
MESSAGE. This message is synchronized to a sub-multiple of the MASTER CLOCK
frequency. For more detail see the TIMS Advanced Modules User Manual
3. use the 8.333 kHz TTL SAMPLE CLOCK as the PCM CLK
4. select the 4-bit encoding scheme
5. switch the front panel toggle switch to 4-BIT LINEAR (ie., no companding).
6. connect the Vin input socket to ground of the variable DC module.
7. connect the frame synchronization signal FS to the oscilloscope ext. synch. input.
8. start with a DC message. This gives stable displays and enables easy identification of
the quantizing levels.

TIMS Lab Sheet copyright  tim hooper 1999, amberley holdings pty ltd ACN 001-080-093 2/4
Emona-TIMS PCM - encoding L-24 rev 1.3

9. on CH1-A display the frame synchronization signal FS. Adjust the sweep speed to
show three frame markers. These mark the end of each frame.
10. on CH2-A display the CLK signal.
11. record the number of clock periods per frame.

Currently the analog input signal is zero volts (Vin is grounded). Before checking with the
oscilloscope, consider what the PCM output signal might look like when the DC input level
is changed. Make a sketch of this signal, fully annotated. Then:
12. on CH2-B display the PCM DATA from the PCM DATA output socket.
Except for the alternating pattern of ‘1’ and ‘0’ in the frame marker slot, you might have
expected nothing else in the frame (all zeros), because the input analog signal is at zero
volts. But you do not know the coding scheme.
There is an analog input signal to the encoder. It is of zero volts. This will have been coded
into a 4-bit binary output number, which will appear in each frame. It need not be ‘0000’.
The same number appears in each frame because the analog input is constant.
The display should be similar to that of Figure 3 below, except that this shows five frames
(too many frames on the oscilloscope display makes bit identification more difficult).

FS - end of frame marker

FS - frame sync

PCM data out

clock periods

LSB at end of frame


time

Figure 3: 5 frames of 4-bit PCM output for zero amplitude input

Knowing:

• the number of slots per frame is 8


• the location of the least significant bit is coincident with the end of the frame
• the binary word length is four bits
• the first three slots are ‘empty’ (in fact filled with zeros, but these remain unchanged
under all conditions of the 4-bit coding scheme)
then:

13. identify the binary word in slots 4, 3, 2, and 1.

quantizing levels for 4-bit linear encoding


14. remove the ground connection, and connect the output of the VARIABLE DC module
to Vin. Sweep the DC voltage slowly backwards and forwards over its complete range,
and note how the data pattern changes in discrete jumps.

TIMS Lab Sheet copyright  tim hooper 1999, amberley holdings pty ltd ACN 001-080-093 3/4
Emona-TIMS PCM - encoding L-24 rev 1.3

15. if a WIDEBAND TRUE RMS METER module is available use this to monitor the DC
amplitude at Vin - otherwise use the oscilloscope (CH1-B). Adjust Vin to its maximum
negative value. Record the DC voltage and the pattern of the 4-bit binary number.
16. slowly increase the amplitude of the DC input signal until there is a sudden change to
the PCM output signal format. Record the format of the new digital word, and the input
amplitude at which the change occurred.
17. continue this process over the full range of the DC supply.
18. draw a diagram showing the quantizing levels and their associated binary numbers.

4-bit data format


From measurements made so far it should be possible to answer the following:

• what is the sampling rate ?


• what is the frame width ?
• what is the width of a data bit ?
• what is the width of a data word ?
• how many quantizing levels are there ?
• are the quantizing levels uniformly (linearly) spaced ?

7-bit linear encoding


It would take a long time to repeat all of the above Tasks for the 7-bit encoding scheme.
Instead:

companding
This module is to be used in conjunction with the PCM DECODER in a later Lab Sheet. As
a pair they have a companding option. There is compression in the encoder, and expansion
in the decoder. In the encoder this means the quantizing levels are closer together for small
input amplitudes - that is, in effect, that the input amplitude peaks are compressed during
encoding. At the decoder the ‘reverse action’ is introduced to restore an approximate linear
input/output characteristic.
It can be shown that this sort of characteristic offers certain advantages, especially when the
message has a high peak-to-average amplitude characteristic, as does speech, and where the
signal-to-noise ratio is not high.
This improvement will not be checked in this experiment. But the existence of the non-
linear quantization in the encoder will be confirmed.
In a later Lab Sheet, entitled PCM - decoding, it will be possible to check the input/output
linearity of the modules as a compatible pair.

periodic messages
Although the experiment is substantially complete, you may have wondered why a periodic
message was not chosen at any time. Try it.
You will see that the data signal reveals very little. It consists of many overlaid digital
words, all different.
One would need more sophisticated equipment than is assumed here (a digital analyzer, a
storage oscilloscope, ability to capture a single frame, and so on) to deduce the coding and
quantizing scheme from such an input signal.

TIMS Lab Sheet copyright  tim hooper 1999, amberley holdings pty ltd ACN 001-080-093 4/4

You might also like