You are on page 1of 7

College of Engineering

Department of Electrical Engineering


Spring 2018

Communications Lab (ELE361L)


Lab # 8

Sampling and Pulse Code Modulation


Objectives
After completing this experiment, the student will be able to:
 Perform sampling of analog signals.
 Examine the spectrum of sampled signals.
 Investigate aliasing in sampled waveforms.
 Describe quantization and encoding of analog samples.
 Implement a pulse code modulation system.

Background

Sampling
Digital transmission systems are typically used to transmit digital information. However, where the
information (message) to be transmitted is an analog signal like speech or music, it must be converted to digital
first. This involves sampling which requires that the analog message is measured at regular time intervals.
Figure 1a shows a pure sine wave message and below the message is a digital sampling signal used to tell the
sampling circuit when to measure the message and sets the sampling rate. Below that is the result of naturally
sampling the message at the rate set by the sampling signal. This type of sampling is called natural because
during the time the analog signal is measured, any change in the voltage is measured too.
Figure 1b shows an alternative sampling scheme, where the sample voltage is fixed at the instant that the signal
is measured. This is known as sample and hold.

Figure 1a Figure 1b

1-7
Regardless of the method used, sampling involves capturing pieces of the message. So how can the sampled
signal be used to recover the whole signal? This can be answered by considering the mathematical model that
defines the sampled signal as the multiplication of the message with the sampling signal.

Sampled message= sampling signal x message


Sampled message= (DC + fundamental + harmonics) x message

For a pure sinewave message, the above expression tells us that the frequency components in the sampled
message are as follows:

o A component at the same frequency as the message.


o A pair of components that are the sum and difference of the fundamental and message frequencies.
o Many other pairs of frequency components that are the sum and difference of the sampling signal
harmonics and the message.

This means the sampled message has many sinewaves but one of them has the same frequency as the message.
So reconstructing the original message involves passing the sampled signal through a low pass filter. This lets
the message frequency (sinewave) through while rejecting the other frequencies. This is possible because the
other frequencies (called aliases) are high enough to be rejected by the filter. Their frequency is determined by
the sampling signal frequency (sampling rate). If the sampling signal frequency is low enough one or more of
the lower frequency aliases can pass through the filter with the message. Obviously, this would distort the
reconstructed message which is a problem known as aliasing.

To avoid aliasing, the minimum sampling frequency needs to be twice the message frequency or (twice the
highest frequency in the message if it contains more than one frequency) and this figure is known as the Nyquist
sampling rate.

PCM Encoding

PCM is a system for converting analog message signals to a serial stream of 0’s and 1’s. The conversion
process is called encoding and involves:

o Sampling the analog signal using a sample-and-hold scheme.


o Comparing each sample to a set of reference voltages called quantization levels.
o Assigning to the sampled voltage the quantization level that is closest to it..
o Generating the binary number for that quantization level.
o Outputting the binary number serially (one bit at a time)

The PCM encoder sampling frequency is determined by the clock frequency and must be at least twice the
message frequency to avoid aliasing.
The encoder assigns to the sample the closest quantization level and so the original sample value is lost and
the difference is known as quantization error. The size of the error is affected by the number of quantization
levels. The more the quantization levels the closer they are together and the smaller the difference between
them and the samples.

Equipments
 Emona Telecoms-Trainer 101.
 Oscilloscope.

Procedure

1. Sampling of a Sinewave Message

The Emona Telecoms-Trainer 101 has a Dual Analog Switch module that can be used for sampling. This part
of the experiment lets you use the module to sample a simple message using two techniques.

 Connect the set-up shown in Figure 2 below.

2-7

Figure 2

The set-up in Figure 2 can be represented by the block diagram in Figure 3 below. It uses an electronically
controlled switch to connect the message signal (the 2kHz SINE output from the Master Signals module) to the
output. The switch is opened and closed by the 8kHz DIGITAL output of the Master Signals module.

Figure 3

 Adjust the scope’s Timebase control to view two or so cycles of the Master Signals module’s 2kHz SINE
output. Set the vertical attenuation to 1 V/div

 Sketch both the message as well as the sampled message as shown on the scope.

Q1) What type of sampling is this? How many samples are taken per one period of the message?

 Use the spectrum analyzer to measure the sampled signal spectrum.

Q2) Describe the spectrum of the sampled signal? Why the sampled signal spectrum doesn’t show side
components about the even multiples of the sampling frequency?

 Modify the set-up as shown in Figure 4 below

Note: Dotted lines show leads already in place.

3-7
Figure 1

The electronically controlled switch in the original set-up has been substituted by a sample-and-hold circuit.
However, the message and sampling signals remain the same (that is, a 2kHz sinewave and an 8kHz pulse
train).

 Sketch the new sampled message as shown on the scope.

Q3) What two features of the sampled signal confirm it is a sample and hold signal?

2. Reconstructing a Sampled Message

Recall that the sampled message is made up of many sinewaves. Importantly, for every sinewave in the
message, there’s a sinewave in the sampled message with the same frequency. So “reconstructing” the original
message involves passing the sampled message signal through a low-pass filter. This lets the sinewave (or
sinewaves) with the same frequency as the message through while rejecting the other sinewaves.

 Set the Tuneable LPF gain control to about the middle and turn its cut-off frequency control fully anti-
clockwise.

 Connect the sample and hold signal to the Tuneable LPF and observe the LPF output on the scope’s channel
2. Keep channel 1 connected to the original 2 KHz message.

At this point there should be nothing out of the Tuneable Low-pass Filter module. This is because it has been
set to reject almost all frequencies, even the message. However, the cut-off frequency can be increased by
turning the module’s Cut-off Frequency Adjust control clockwise

 Slowly turn the Tuneable Low-pass Filter module’s Cut-off Frequency control clockwise and stop the
moment the message signal has been reconstructed.

 Sketch the reconstructed message and record its frequency.

3. Aliasing

The next part of the experiment lets you vary the sampling signal’s frequency to observe aliasing.

 Set the VCO module Frequency Adjust control fully clockwise, and Range control to the LO position.

 Modify the set-up as shown in figure 5 below. The sampling signal is now provided by the VCO module and
the sampling frequency can be varied.

At this point, the sampling of the message and its reconstruction should be working normally.

 Slowly reduce the frequency of the VCO module’s output (by turning its Frequency Adjust control anti-
clockwise) while watching the reconstructed message signal.
4-7
 Sketch the distorted message as shown on the scope.

Q1) What’s the name of the distortion that appears when the VCO frequency is decreased below certain
value?

Q2) Given the message is a 2kHz sinewave, what’s the theoretical minimum frequency for the sampling
signal?

 Turn the VCO module’s Frequency Adjust control clockwise and stop the moment the reconstructed
message is no-longer distorted.

 Connect the scope’s Channel 1 input to the VCO module’s DIGITAL output and measure the VCO output
frequency. Record the VCO frequency below.

VCO Frequency=__________

Q3) Compare the measured minimum sampling frequency (for no distortion) with the theoretical minimum
frequency calculated in Q2? Why the practical minimum sampling frequency is higher?

Figure 5

4. Pulse Code Modulation

PCM Encoding of a Variable DC Voltage

 Connect the setup shown in Figure 6 below which can be represented by the block diagram in Figure 7. The
PCM encoder analog input is 0 V and clocked from the 8 KHz digital signal from the master signals module.
The PCM encoder also outputs frame synchronization (FS) signal that goes high every time the least
significant bit of the 8 bits code is outputted. The FS signal is used by the decoder to detect the beginning
of each new frame.

 Display the clock signal and the frame synchronization signal on the scope. Sketch both signals below each
other.

Q1) What is the number of clock cycles per one cycle of the FS signal? How many bits are generated in each
frame?

 Connect the scope’s channel 2 input to the PCM encoder’s output. Sketch the PCM signal that corresponds
to 0 V input.

5-7
Figure 6

Figure 7
Q2) What is the binary number the PCM encoder is outputting?

Q3) Why the output code for 0 V is not 00000000?

 Replace the input voltage to the encoder by a variable dc from the module’s VDC output.

 While watching the PCM output on the scope, gradually turn the VDC control from fully anti- clockwise
to fully clockwise.

Q4) What happens to the binary code when varying the input DC voltage?

 Measure with a DC voltmeter the input voltage to the PCM encoder whose output code is 00000000 and
the input voltage whose code is 11111111.

Vin_min=_____________ PCM code: 00000000

Vin_max=____________ PCM code: 11111111

 Calculate the quantization step as:

Quantization Step=(Vmax-Vmin)/256=_______

Q5) Based on the above information, what is the maximum peak to peak amplitude for a sinewave input to
the PCM encoder?

PCM Encoding and Decoding of a Sinewave Message

Now we will see what happens when the PCM encoder is used to convert continuously changing signals
like a sine wave.

6-7
 Use the VCO module as a sinewave message source. Set the VCO range control to the LO position and turn
its frequency adjust control fully anti-clockwise.

 Connect the VCO sinewave output to the PCM encoder’s input 1. This is the input analog message.

 Connect the 100 KHz digital signal from the Master signals module to the encoder clk.

 Observe the PCM DATA output on the oscilloscope’s channel 1. The PCM data is changing continuously
in response to the change in the input message.

 Modify the setup as shown in Figure 8.

Figure 11

Figure 8

 Adjust the oscilloscope to view the PCM decoder output as well as the message. Sketch the two waveforms
as seen on the oscilloscope.

Q6) What type of signal is the PCM decoder’s output?

The message can be reconstructed from the PCM decoder output through a low pass filter.

 Connect the decoder output to the tunable low pass filter and set its gain control to mid position and cut-off
frequency control fully anti-clockwise.

 Move the oscilloscope’s channel 2 to the filter output to observe the recovered message.

 Adjust the filter cut-off frequency until the message has been reconstructed (ignoring phase shift).

 Sketch the original message and the reconstructed message as seen on the scope.

7-7

You might also like