Experiment-2_PCM-Encoding
Experiment-2_PCM-Encoding
Preliminary Discussion
PCM is a system for converting analog message signals to a serial stream of
0s and 1s. The conversion process is called encoding. At its simplest, encoding
involves:
Sampling the analog signal’s voltage at regular intervals using a Flat-top
scheme.
Comparing each sample to a set of reference voltages called quantization
levels.
Deciding which quantization level the sampled voltage is closest to.
Generating the binary number for that quantization level.
Outputting the binary number one bit at a time (that is, in serial form).
Taking the next sample and repeating the process.
An issue that is crucial to the performance of the PCM system is the
encoder’s clock frequency. The clock tells the PCM encoder when to sample and,
as the previous experiment shows, this must be at least twice the message
frequency to avoid aliasing (or, if the message contains more than one sinewave,
at least twice its highest frequency). Another important PCM performance issue
relates to the difference between the sample voltage and the quantization levels
that it is compared to. To explain, most sampled voltages will not be the same as
any of the quantization levels. As mentioned above, the PCM Encoder assigns to
the sample the quantization level that is closest to it. However, in the process, the
original sample’s value is lost and the difference is known as quantization error.
Importantly, the error is reproduced when the PCM data is decoded by the
receiver because there is no way for the receiver to know what the original
sample voltage was. The size of the error is affected by the number of
quantization levels. The more quantization levels there are (for a given range of
sample voltages) the closer they are together and the smaller the difference
between them and the samples.
The PCM Encoder module uses a PCM encoding and decoding chip (called a
codec) to convert analog voltages between -2V and +2V to an 8-bit binary
number. With eight bits, it’s possible to produce 256 different numbers between
00000000 and 11111111 inclusive. This in turn means that there are 256
quantization levels (one for each number). Each binary number is transmitted in
serial form in frames. The number’s most significant bit (called bit-7) is sent first,
bit-6 is sent next and so on to the least significant bit (bit-0). The PCM Encoder
module also outputs a separate Frame Synchronization signal (FS) that goes high
at the same time that bit-0 is outputted. The FS signal has been included to help
with PCM decoding but it can also be used to help “trigger” a scope when looking
at the signals that the PCM Encoder module generates. Figure 1 below shows an
example of three frames of a PCM Encoder module’s output data (each bit is
shown as both a 0 and a 1 because it could be either) together with its clock input
and its FS output.
Procedure
Part A – An introduction to PCM encoding using a static DC voltage
1. Gather a set of the equipment listed above. Set up the scope per the
instructions in Experiment 1.
2. Ensure that:
the Trigger Source control is set to the CH1 (or INT) position.
the Mode control is set to the CH1 position.
3. Locate the PCM Encoder module and set its Mode switch to the PCM position.
4. Connect the set-up shown in Figure 2 below.
13. Draw this waveform to scale in the space that you left on the
graph paper. Tip: If you’re having trouble triggering the CRO set its Trigger
Source Coupling control to the HF REJ position.
Question 1 Indicate on your drawing the start and end of the frame. Tip: If you’re
not sure where these points are, see the preliminary discussion.
________________________________ __________________________________
Question 2 Indicate on your drawing the start and end of each bit.
___________________________________________________________________
Question 3 Indicate on your drawing which bit is bit-0 and which is bit-7.
___________________________________________________________________
Question 4 What is the binary number that the PCM Encoder module is
outputting?
___________________________________________________________________
Question 5 Why does the code change even though the input voltage is steady?
___________________________________________________________________
Question 6 Why does the PCM Encoder module output this code for 0V DC and
not 0000000?
___________________________________________________________________
18. Set the scope’s Channel 1 Vertical Attenuation control to the 1V/div position.
19. Set the scope’s Channel 1 Input Coupling control to the GND position.
20. Use the scope’s Channel 1 Vertical Position control to align the Channel 1
trace with one of the horizontal lines on the scope’s screen. Note: This line on the
scope’s screen is now your zero volt reference which you can use to see whether
the Variable DCV module’s output is positive or negative.
21. Set the scope’s Channel 1 and Channel 2 Input Coupling controls to the DC
position.
22. Set the scope’s Mode control to the DUAL position.
23. Adjust the Variable DCV module’s Variable DC control until the PCM Encoder
module outputs the code that you drew earlier.
24. Use the scope to measure the Variable DCV module’s output voltage. Note: It
should be very close to 0V.
25. Turn the Variable DCV module’s Variable DC control clockwise while watching
the scope’s display.
Question 7 What happens to the Variable DCV module’s output?
___________________________________________________________________
Question 8 In what way does the binary number that the PCM Encoder module
outputs change?
___________________________________________________________________
26. Continue to turn the Variable DCV module’s Variable DC control clockwise and
stop the moment the PCM Encoder module’s output is 11111111. Note: You may
not be able to obtain 11111111 on the PCM Encoder module’s output. If this is
the case, for the moment, settle for an input that generates the highest binary
number possible.
27. Use the scope to measure the PCM Encoder module’s input voltage. Record
your measurement in Table 1.
Question 9 It is possible that you were unable to obtain 11111111 on the PCM
Encoder module’s output at Step 26. Explain why. Tip: Use the User Manual to
compare the operating specifications of the Variable DCV and PCM Encoder
modules.
___________________________________________________________________
Question 10 Devise a method of obtaining a variable DC voltage that can reach
(or exceed) the upper and lower limits of the PCM Encoder module’s input range.
Describe your solution below.
___________________________________________________________________
28. Implement your solution to Question 10 and repeat Steps 26 and 27. Note:
Make this change even if you were able to obtain 11111111 on the PCM Encoder
module’s output. This will ensure that you’ll be able to successfully complete Step
31.
29. Make the necessary adjustments to the set-up so that the PCM Encoder
module’s input voltage is a small negative value (say -0.2V).
30. Increase the size of the negative voltage on the PCM Encoder module’s input
and note the effect on the binary number on its output.
Question 11 What happens to the binary number on the PCM Encoder module’s
output as the size of the negative input voltage increases?
___________________________________________________________________
31. Continue to increase the PCM Encoder module’s input voltage and stop the
moment its output is 00000000.
32. Measure the Variable DCV module’s output voltage and record the value in
Table 1 on the previous page.