Lab 7
Lab 7
Purpose:
The purpose of this lab is to introduce you to Pulse Code Modulation and Demodulation.
As part of performing this lab you will investigate
• the digitization of an analog signal,
• the reconstruction of the original analog signal,
• the measurement of quantizing noise,
• the causes and prevention of aliasing, and
• the causes and effects of channel errors.
Introduction
During the lab period you will build both a PCM encoder and decoder. For the encoder
you will use the Texas Instruments TL5501 6-Bit Analog-to-Digital Encoder. The
encoder uses the National Instruments DAC0806 Digital-to-Analog Decoder. Data sheets
for each chip are available on the Internet at
http://www-s.ti.com/sc/psheets/slas026/slas026.pdf
and
http://www.national.com/ds/DA/DAC0806.pdf.
PCM (Pulse Coded Modulation) is a waveform-coding scheme designed to reproduce the
waveform output of the source at the destination with minimum distortion. In this lab, the
emphasis is not on the internal chip architecture which produces the waveform, the focus
is, instead, reproduction of the source signal at the output with a high degree of accuracy.
Quantization and waveform coding procedures are important factors for digital
communication systems, directly affecting the performance of the transmission system.
The steps shown in Figure 1 are called Analog-to-Digital conversion (and the IC which
performs the function is called an Analog-to-Digital Converter, ADC). At the receiver, in
most cases, the signal undergoes a corresponding Digital-to-Analog conversion.
Prelab 7.1
1. Carefully review the data sheets prior to building the circuit.
2. Study how to measure the signal to quantization error ratio, Peak Quantization Error,
and Bit Error Rate (BER).
Page 1 of 5 Revision C
Prelab 7.2
1. Use the 8-bit uniform quantizer to simulate PCM. The MatLab files are available from
the CommLab Web site as a single, self-extracting file:
http://www.utdallas.edu/~gibbs/commlab/Lab7.zip
2. Calculate how many quantization levels are generated by 8-bit uniform quantizer.
Complete Table 1 by calculating the Signal to Quantization Noise Ratio ( SQNR) for
4-bit, 6-bit, and 8-bit quantizers.
3. The input signal is a 1 Vpp, 1 kHz sine wave. In MatLab, create a waveform
corresponding to this signal in the time window 0 < t < 0.002 sec. Generate as many
data points as possible within the time span (at least 1000). Assume that the quantizer
has been designed for the input range [-1, 1]. There are numerous techniques for
quantizing an analog signal. The procedure that MatLab uses is called natural binary
coding; which means that 1 is represented by 000001. Compare the manually
calculated SQNRs with SQNRs calculated theoretically,
Quantizing Levels
Signal to
Quantization Noise
Ratio [dB]
Table 1.
P a r a ll e l
S a m p le r Q u a n tiz e r E ncoder t o S e ri a l
C o n v e r to r
+
C hannel
S e r ia l to
R e c o n s tr u c te d
D ecoder P a r a ll e l
S ig n a l
C o n v e r to r
This block diagram models the MatLab simulation for prelab 7.2.
Page 2 of 5 Revision C
Lab 7: Pulse Code Modulation
Page 3 of 5 Revision C
Parts required for Lab 7
Resistors:
1 – 1.2 KΩ
1 – 2.4 KΩ
3 – 5.1 KΩ
1 – 5.6 KΩ
1 – 100 KΩ
3 – 330 KΩ
Capacitors:
Determined by circuit
Integrated circuits:
1 – TL5501 A/D Converter
1 – DAC0806 D/A Converter
2 – Op-amp uA741
Lab 7 Procedure
1. Construct the PCM modulator/demodulator shown in Figure 3. The TL5501 has
some strict parameters for the input signal, the input can be a maximum of 1 Vpp, in the
DC range of 4 VDC to 5 VDC.
Using the multimeter, verify that the DC voltage applied to pin 12 of TL5501 is
approximately 4.5 V and the voltage at pin 13 is about 4.0 V. Use a square wave with
an of amplitude 2.5 Vpp, an offset 1.25 V, and a frequency of 50 kHz (all displayed
values) as the sampling signal applied to pin 7.
2. Connect a sine wave of 350 mVpp (displayed value) to the input. Use channel 2 to
observe this signal and channel 1 to observe the reconstructed output signal (at pin 6
of U4). Notice that the signals are approximately 180° out of phase due to the inverter
in the input stage.
3. Repeat step 2 with square, triangle, and ramp waveforms for the input signal. In your
report, comment on the results. With the triangle wave as the input, stabilize the
display by adjusting the signal frequency (or the sampling frequency), then use
“cursors” to measure the peak quantizing error.
4. Verify the sampling theorem recording the spectrum of the reconstructed signal using
WAVEFFT.VI. Analyze the following cases. To keep your data uniform, use a time
span such that the resulting frequency span is 100 kHz (try 10 ms or 5 ms), then zoom
in on the time domain plot to show a 5 ms time span:
Page 4 of 5 Revision C
In the Lab Report: Q1. Compare cases a) and c) in the time domain and explain why
the signal in c) was closer to the original signal. Compare the spectra of both cases in
the frequency range of 0-10 kHz. Can we recover the original signal from both cases?
If so, explain how.
In the Lab Report: Q2. Observe the amplitudes of the spectral components in b), if
the sampling were ideal, how would the amplitudes be?
In the Lab Report: Q3. From the spectrum obtained in d), explain how we could get a
triangle waveform of 41 kHz.
4. Aliasing occurs when the sampling frequency is less than two times the signal
frequency. Display aliasing frequencies in the time domain. Set the input frequency to
16 kHz and the sampling frequency to 5.3 kHz. Observe the recovered signal (adjust
the "Time/Div" knob to 2.5 ms/div). Measure the frequency of the signal. Due to the
lack of synchronizaton, you might need to use the storage mode of the oscilloscope
pressing the "Stop" and "Run" buttons as be necessary. Record the value of the alias
frequency.
5. Record the spectrum of the output signal using WAVEFFT.VI. In your report, explain
how aliasing caused the output signal you observed.
In the Lab Report: Q4. In step 4 you viewed an alias signal. What in the
configuration should be changed to correct the aliasing? Manually, sketch a frequency
domain plot of the signal which produced the alias frequency.
Report
This lab report is defined as formal, so in your report, be sure to include an abstract, and
sections which give the lab’s purpose and a basic theory of operation for PCM. Also
remember, the report must be typed, including all graphs and charts (except the drawing
specified in Step 5, Question 4 of the Lab Procedure).
Answer all questions specified in the instruction sheet.
Page 5 of 5 Revision C