Experiment 6: Pulse Code Modulation: T x T t + 2x (t) cos 4πf t + 2x (t) cos 6πf t + - . .) x (t) T t)
Experiment 6: Pulse Code Modulation: T x T t + 2x (t) cos 4πf t + 2x (t) cos 6πf t + - . .) x (t) T t)
Experiment 6: Pulse Code Modulation: T x T t + 2x (t) cos 4πf t + 2x (t) cos 6πf t + - . .) x (t) T t)
This experiment deals with the conversion of an analog signal into a digital signal, the coding of the
digital signal into pulses (Pulse Code Modulation), and the recovery of the analog signal at the receiver
end (demodulation). The integrated circuits that are utilized in this experiment are the Analog-to-Digital
Converter (ADC) TL5501 and the Digital-to-Analog Converter (DAC) DAC0806.
1 Introduction
From the sampling theorem, it is known that a signal x(t) that is bandlimited to B Hz can be reconstructed
from its samples taken uniformly at a rate greater than 2B samples per second. Ideally, the sampling
is performed by multiplying x(t) by a train of (physically nonexistent) impulses δTs (t) spaced Ts , where
Ts = 1/fs is the sampling period and fs is the sampling rate. The sampled signal xs (t) is expressed as:
Hence the spectrum Xs (f ) of a sampled signal consists of repetitions of X(f ) every fs Hz. If fs < 2B,
overlapping of the repetitions of X(f ) occurs leading to a condition known as aliasing. The minimum
sampling rate required to avoid aliasing is called the Nyquist rate, fs = 2B. However, at the Nyquist rate,
an ideal lowpass filter would be necessary to recover x(t) from its samples xs (t) hence a higher sampling rate
is needed in practice.
Sampling allows for the conversion of an analog signal into a digital signal after a quantization is made
on the amplitude of the samples. Quantizing is the process of rounding off the sample value to the closest
permissible discret value (quantizing level). The quantizing levels are determined by the analog-to-digital
converter characteristics, specifically, the analog input voltage range (Vmin , Vmax ) and the number L of
quantizing levels. The levels are separated by the step size
Vmax − Vmin
∆v = (3)
L
The sample must be approximated to the closest quantizing level producing a maximum quantization error
of ±∆v/2. The quantization error can be considered as noise introduced to the samples before quantizing,
and the power of the quantization noise is
(∆v)2
Nq = (4)
12
The L-ary digital signal (L levels), discret in time and amplitude can be converted into a binary signal (2
levels) by using pulse coding. The code is formed by assigning a binary representation of the decimal number
to each of the levels from 0 to L − 1. In a 32-ary signal for example, the binary code for level 0 is 000002
1
EE3150 E. Cura 2
and 101002 represents level 20. When this pulse-coded signal is transmitted, 5 binary digits (or bits) are
sent for each sample of xs (t) every Ts seconds. Generally, L is a power of two, such that L = 2n , where n is
the number of bits necessary to pulse-code the signal. The bits are represented by two voltage levels. In the
TL5501 ADC circuit, 0 and Vcc volts represent bits 0 and 1 respectively.
2 Prelab instructions
Enclosed in brackets is the number of points assigned to each question.
1. From the TL5501 data sheet determine:
(a) The number of bits n and quantizing levels L. [2].
(b) The recommended input voltage range (Vmin , Vmax ) at the analog input of this ADC. [2].
(c) The highest frequency B of the signal that can be sampled with this ADC without aliasing. [2].
(d) The step size ∆v and maximum quantization error ∆v/2. [2].
(e) Function table in page 3 of the data sheet presents several digital output codes (binary codes) for
different analog input voltages, determine the binary code for the following analog input voltages
(all in Volts): [2 points each]
i. 4.101.
ii. 4.489.
iii. 4.916.
2. In practice, the sampled signal xs (t) is produced by sampling x(t) with a train of pulses because
impulses are physically nonexistent. This have some impact on the spectrum of the sampled signal.
We will be unable to observe the sampled signal when using the TL5501, as the sampling process is
internal to the integrated circuit.
In the lab, we will see the spectrum of the signal reconstructed by the digital-to-analog converter.
Although this signal is continuous in time and amplitude it shows the quantization process that occurs
in the ADC. An approximation to the spectrum of the reconstructed signal is
∞
X
cs (f ) = sinc(Ts f )
X X(f − nfs ) (5)
n=−∞
From Eq.(5):
cs (f ) when x(t) = A cos(2πBt). [2].
(a) Determine the spectrum X
(b) Create one-sided spectral plots of this spectrum for the cases enumerated below. Plot only fre-
quencies between the specified range and neglect components with magnitude below -60 dBV
(noise floor is -60 dBV). Hint: You must consider the components that arise from the negative
side of the frequency axis, in other words, consider n from -10 to 10 to make sure all the compo-
nents are shown in the positive side of the spectrum. The parameters for the signal and for the
plot are specified next. [3 points each plot].
i. A=1 V, B=1.0 kHz, fs =10 kHz, FS=100 kHz (Freq. span from 0 to 100 kHz).
ii. A=1 V, B=1.0 kHz, fs =95 kHz, FS=100 kHz.
iii. A=1 V, B=10.2 kHz, fs =5 kHz, FS=20 kHz.
These spectra will be taken experimentally in the lab.
EE3150 E. Cura 3
3 Lab procedure
GENERAL INSTRUCTIONS:
• Keep the power supply off during the assembling of any circuit.
• After taking each plot make sure to ask your TA to verify that your results are correct.
This also serves to monitor your progress and performance.
Voltage range (V) Actual voltage VI (V) Pin 6 Pin 5 Pin 4 Pin 3 Pin 2 Pin 1
4.000-4.330
4.330-4.660
4.660-5.000
2. Connect node B to pin 12 of the ADC and use FG1 as the message signal with the following parameters:
Amplitude=0.45 V, Frequency=1 kHz, Waveform=sine.
3. Using channel 1 of the oscilloscope verify the presence of rectangular pulses at the digital outputs of the
ADC (pins 1 through 6). You may need to adjust the Time/Div setting of the oscilloscope to observe
the train of pulses in each of the digital outputs.
4. Turn the power supply off and complete the assembling of the modem by adding the digital-to-analog
converter as shown in Fig. 3. To avoid connection errors, begin connecting the power and ground
connections to the DAC0806 and then the connections to the ADC.
5. Turn on the power supply and use channel 1 to observe the demodulated output signal 1 . Use channel
2 to observe the message signal from FG1. At the output you should observe a signal that looks like a
staircase, clearly this is the effect of the quantization process that occurs in the ADC.
Notice that the LPF at the output of the op-amp has a very high cut-off frequency since it is used to
reduce high frequency noise while keeping the spectral components of interest unchanged.
6. Increase the sampling frequency to 50 kHz, you should see that the message signal has been recovered
at the output. If clipping is observed at the output reduce the amplitude of the message signal.
7. Using TIMEFREQ.vi capture the signals and their magnitude spectra for the cases listed in Table 2.
Use a different file name for each plot. Important: The spectral components should be well defined,
it may be necessary to run TIMEFREQ.vi several times in order to get a clear picture of the spectrum
for each case in Table 2.
Plot Message waveform Message freq. (kHz) Sampling freq. (kHz) Channel TS FS
P1 sine 1.0 10.0 1 4E-3 100
P2 sine 1.0 35.0 1 4E-3 100
P3 sine 1.0 40.0 1 4E-3 100
P4 sine 1.0 95.0 1 4E-3 100
P5 triangle 1.0 N/A 2 4E-3 100
P6 triangle 1.0 20.0 1 4E-3 100
P7 sine 10.2 5.0 1 20E-3 20
P8 sine 15.2 5.0 1 20E-3 20
3.3 Analysis
This section contains questions regarding the results you obtained in the lab.
1. Present all the plots obtained during the lab. Make sure to label properly all the plots. The number
of points assigned to each plot is specified in the lab procedure. Refer to Appendix B section 3.4 for
instructions regarding the plotting of experimental results.
2. Obtain the theoretical binary codes of the actual analog input voltages of Table 1 and compare these
values with the experimental results. [3].
3. Observe the spectrum of plot P1, explain why the repetitions of the spectrum of the sine wave get
smaller as the frequency increases. [2]
1 Note: No voltage signal is produced at the output of the DAC0806 since it requires an external current at pin 4, therefore
4. Observe the spectrum of plot P2, you will agree that the repetitions of X(f ) that occur at 35 and 70
kHz are expected as these frequencies are multiples of fs = 35 kHz for this particular case. Explain
however, the presence of the repetitions of X(f ) at 95 kHz and another (it may not be clear in your
plot) at 60 kHz, and why the spectrum of plot P3 does not show any repetition at any frequency other
than multiples of fs = 40 kHz. [4]. [Hint: the oscilloscope is also sampling the signal at a rate of 200
kHz.]
5. Giving arguments from the spectrum in plot P4 (compare it with P1), explain why the time domain
signal for this case resembles more closely the analog input signal (a sine wave). [2]
6. Observe the spectrum in plot P5, (a) estimate the bandwidth B of this signal.[2] (b) From plot P6,
Was the Nyquist rate satisfied in this case? What sampling frequency fs would you have used? [3].
7. Observe the plots P7 and P8. (a) Estimate the frequency fm of the time domain signal.[2] (b) Explain
why these two plots are similar despite the fact they were taken from input signals with different
frequencies.[2].
2 1
P9 P8 P9 P8
P10 P7 5.6k P10 P7
39k
P11 P6 P11 P6
A MSB B MSB
P12 P5 message_signal P12 P5
P13 P4 10u P13 P4
11k P14 P3 P14 P3
B B
P15 P2 2.4k P15 P2
R1 1k R1 1k
P16 P1 LSB P16 P1 LSB
TL5501 TL5501
+15V +5V
0.1u sampling_signal
10k
P9 P8
5.6k P10 P7 +15V 0.1u
P11 P6
B
message_signal P12 P5 7
P13 P4 P9 P8 3 5
10u +
P14 P3 P10 P7 V+ Ouput_signal
2.4k P15 P2 P11 P6
OS2 6
R1 1k OS1
P16 P1 P12 P5 V- 510 1n
P13 P4 2 - 1
+5V
TL5501 P14 P3 4
5.1k P15 P2 -15V uA741
P16 P1
-15V
A 5.1k
DAC0806
A
0.1u
2 1