0% found this document useful (0 votes)
7 views

Experiment-2_PCM-Encoding

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Experiment-2_PCM-Encoding

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Experiment 12 – 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.

The set-up in Figure 2 can be represented by the block diagram in


Figure 3 below. The PCM Encoder module is clocked by the Master Signals
module’s 8kHz DIGITAL output. Its analog input is connected to 0V DC.
5. Adjust the scope’s Timebase control to view three pulses of the PCM
Encoder module’s FS output.
6. Set the scope’s Slope control to the “-” position. Setting the Slope control
to the “-“ position makes the scope start its sweep across the screen when
the FS signal goes from high to low instead of low to high. You can really
notice the difference between the two settings if you flip the scope’s Slope
control back and forth. If you do this, make sure that the Slope control
finishes on the “-” position.
7. Adjust the scope’s Horizontal Position control so that the start of the
trace aligns with the left-most vertical line on the screen. Adjusting this
scope’s control in this way will make it easier for you to draw the
waveforms that you’ll be asked to shortly. However, you should be aware
that the screen’s horizontal divisions are no-longer equal to the Timebase
control’s setting. In other words, the scope’s Timebase is no-longer
calibrated. This is a problem when measuring the period of signals and so
you must return the control to its locked position at the end of the
experiment.
8. Set the scope’s Timebase control to the 0.1ms/div position.
9. Adjust the scope’s Variable Sweep control until the FS signal looks like
the signal in Figure 4.
10. Set the scope’s Mode control to the DUAL position to view the PCM
Encoder module’s CLK input as well as its FS output.
11. Draw the two waveforms to scale in the space provided leaving enough
room for a third digital signal. Tip: Draw the clock signal in the upper third
of the graph paper and the FS signal in the middle third.
12. Connect the scope’s Channel 2 input to the PCM Encoder module’s
output as shown in Figure 5 below. Remember: Dotted lines show leads
already in place.
This set-up can be represented by the block diagram in Figure 6
below. Channel 2 should now display 10 bits of the PCM Encoder module’s
data output. The first 8 bits belong to one frame and the last two bits
belong to the next frame.

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?
___________________________________________________________________

Part B – PCM Encoding of a Variable DC voltage


So far, you have used the PCM Encoder module to convert a fixed DC
voltage (0V) to PCM. The next part of the experiment lets you see what happens
when you vary the DC voltage.
14. Set the scope’s Mode control to the CH1 position.
15. Set the scope’s Trigger Source control to the EXT position.
16. Set the scope’s Trigger Source Coupling control to the HF REJ position.
17. Modify the set-up as shown in Figure 7 below. Note: Notice that a third input
on the scope is being used. This input is usually labelled EXT or EXTERNAL but its
position varies from one scope to another.
This set-up can be represented by the block diagram in Figure 8. The
Variable DCV module is used to let you change the DC voltage on the PCM
Encoder module’s input. The scope’s external trigger input is used so that you can
view the DC voltage on its Channel 1 input as a stable display.

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.

Question 12 Based on the information in Table 1, what is the maximum allowable


amplitude (peak-to-peak) for an AC signal on the PCM Encoder module’s INPUT?
___________________________________________________________________
Part C – Quantization
33. Remove the Buffer (or Adder) module to return the set-up that shown in
Figure 7 and set the Variable DCV module’s Variable DC control to about the
middle of its travel.
34. See if you can vary the Variable DC control left and right without causing the
output code to change. The sampled voltage can be changed without causing the
output code to change because it is compared to a set of quantization levels but
there are a finite number of them. This means that, in practice, there’s a range of
sample voltages for each quantization level.
Question 13 What’s the name for the difference between a sampled voltage and
its closest quantization level? Tip: If you’re not sure, see the preliminary
discussion. It’s possible to calculate how far apart a PCM encoder’s quantization
levels are using the information you’ve gathered so far. To do so, answer the
following question.
___________________________________________________________________
_________________
Question 14 Calculate the difference between the quantization levels in the PCM
Encoder module by subtracting the values in Table 1 and dividing the number by
256 (the number of codes).
___________________________________________________________________
Question 15 To reduce quantization error it’s better to have
 fewer quantization levels between ±2.5V.
 more quantization levels between ±2.5V.

Part D – PCM Encoding of Continuously Changing Voltages


Now let us see what happens when the PCM encoder is used to convert
continuously changing signals like a sinewave.
35. Return the scope’s Trigger Source control to the CH1 (or INT) position.
36. Return the scope’s Trigger Source Coupling control to the AC position.
37. Set the scope’s Channel 1 and Channel 2 Vertical Attenuation controls to the
2V/div position.
38. Locate the VCO module and set its Range control to the HI position.
39. Turn the VCO module’s Frequency Adjust control fully anti-clockwise. Note:
The VCO module will be used to provide the PCM Encoder module with a 50kHz
(approx) clock.
40. Disassemble the current set-up.
41. Connect the set-up as shown in Figure 9 below

42. Set the scope’s Timebase control to the 50µs/div position.


43. Watch the PCM Encoder module’s PCM DATA output on the scope’s display.
Question 16 Why does the PCM DATA change continuously?
___________________________________________________________________
44. Return the scope’s Variable Sweep control to the detent (locked) position.

You might also like