You are on page 1of 13

ANALOG AND DIGITAL COMMUNICATIONS – LAB.

4 1

4. Introduction to Digital Communications

4.1 OBJECTIVE
The study will focus on simulating digital modulation and demodulation
techniques: PAM (Pulse Amplitude Modulation), PWM (Pulse Width
Modulation) and PPM (Pulse Position Modulation).

4.2 Amplitude modulation


As we have seen in the previous experiments, analog communications
rely on the transmission of continuous-time signals. Digital communications (on
which we will focus our attention in this laboratory) on the other hand, work
with discrete signals. The message is first sampled and processed before its
actual transmission on the communication channel.
The working condition for any digital communications system (which is
based on the information sampling process) is given by Nyquist's Law: in order
to be able to correctly recover a message signal from its samples, the sampling
frequency must be at least twice the maximum frequency of the sampled signal:
fs > 2 * fmax
The 2 * fmax frequency is also called the Nyquist frequency (or rate).
Normally, it is good to avoid the limit case (fs > 2 * fmax, as it would lead to
spectral aliasing), and the sampling frequency must be higher than this Nyquist
rate.
Question: We want to sample a 15KHz message signal. What is the minimum
sampling frequency we can use?
Question (2): If the sampling frequency is 8 KHz, what is the maximum
message signal frequency? Can we sample a voice signal with this frequency, if
it was limited to the bandwidth studied in Lab2(AM)?
Digital communications are split into two categories:
• Digital codes:
o PCM (Pulse Code Modulation)
o Delta modulation
• Digital modulations:
o PAM (Pulse Amplitude Modulation)
o PTM (Pulse Time Modulation)
2 INTRODUCTION TO DIGITAL COMMUNICATIONS

▪ PWM (Pulse Width Modulation)


▪ PPM (Pulse Position Modulation)
Digital codes like the Pulse Code Modulation involve two steps:
• Sampling of the continuous-time signal
• Quantization of the samples – converting amlitudes in 8-bit digital
codes.
A comparison between continuous-time signals (a sine wave) and

Fig. 4.1 Comparison of sine and square signal waveform and spectrum

discrete-time signals (a square waveform) can be observed in Fig. 4.1.


On the first row of graphics you should recognize the waveform and
spectrum for sinusoidal signal, with a frequency of 1KHz.
On the second row of graphs you can see the waveform and the spectrum
of a rectangular pulse, with the same frequency of 1KHz and duty factor of 50%.
Unlike the sinusoidal signal, the spectrum of the rectangular pulse is no longer
limited to a single frequency. Rectangular pulses have an infinite spectrum
(infinite band). However, the real, significant bandwidth will be limited (as
shown in the image).
ANALOG AND DIGITAL COMMUNICATIONS – LAB. 4 3

Figure 4.2 depicts the three types of Pulse-modulated signals (PAM,


PWM and PPM).
For PAM signals, you can see that the amplitude of each pulse is
proportional (equal in our case) to the amplitude of the message signal.

Fig. 4.2 Waveforms for the PAM, PWM and PPM signals

For PWM, on the other hand, the pulse duration varies depending on the
message (amplitude) of each sample. It can be seen that, when the message
signal amplitude is negative, the duration of each pulse is shorter (the duty factor
is below 50%), while for positive values of m(t) we obtain a longer duration for
the pulses.
When modulating the PPM signal, the position of each pulse will change,
relative to the same information.
4 INTRODUCTION TO DIGITAL COMMUNICATIONS

The working principle of the PAM modulator is depicted in Fig. 4.3.

Fig. 4.3 PAM modulator

The simplest configuration for a sampler relies on a simple voltage-


controlled switch. The controlling signal can be a rectangular pulse signal, like
the one in Fig. 4.2.

As a principle, PAM is very similar to the DSB signal modulation (the


informational signal is multiplied by the sampling signal), where instead of the
carrier we have a rectangular pulse train.

Fig. 4.4 PAM signals


ANALOG AND DIGITAL COMMUNICATIONS – LAB. 4 5

Figure 4.4 depicts the waveforms and corresponding spectral components


of all signals involved in the PAM communication. From the spectrum of the
PAM signal, you should see the message, alongside an infinite number of DSB-
SC replicas of the message. This shows that:
• Recovery of the message signal can be as simple as using a LPF
• We can obtain a DSB-SC signal by passing the PAM signal through
a Band-pass filter.
Figure 4.4 also provides a hint to Nyquist’s law.
Practical assignment: Based on the observations from Fig. 4.4, prove Nyquist’s
law.
6 INTRODUCTION TO DIGITAL COMMUNICATIONS

4.3 PAM signal generation and demodulation


Open the PAM.slx model file, with the PAM modulator from Fig. 4.5.
Compared to the previously used blocks, this model adds a predefined Ground
block (the equivalent of a constant 0V block) and a Switch, both available in the
Simulink->Commonly Used Blocks category, in the library browser.

Fig. 4.5 PAM Modulator (natural sampling)

Fig. 4.6 PAM Generation (waveforms)

Note that for the switch we used a 0.5V threshold.


ANALOG AND DIGITAL COMMUNICATIONS – LAB. 4 7

The switch (natural sampler) is triggered by a square pulse signal, with a


frequency of 10 KHz and duty factor of 25%. The message signal frequency is 1
KHz.
Question: What is the maximum message signal frequency we can sample at a
10KHz rate?

Practical assgnments:
1. Run the simulation, then open the scope and compare the waveforms
for the three signals. You should get the same result as in Fig. 4.6.
Note that for the entire width of each pulse, it displays the same
waveform as the message signal. This is the result of natural
sampling.
2. Open the Simulink Library Browser, then go to DSP System Toolbox
-> Filtering -> Filter Implementations and drag the Analog Filter
Design block from this category to the model. Now go the the filter’s
parameters and set Design method to Butterworth, Filter type to
Lowpass, Filter order to 8 and Passband edge frequency to
2*pi*2000 rad/s.

Question: What is the maximum cutoff frequency we can use for an ideal/real
LPF, if we can sample at a 10KHz rate?

Practical assgnments:
3. Connect the input of the filter to the output of the sampler. Then, open
the scope, go to View -> Configuration Properties and change the
number of input ports from 3 to 4. You can now connect the output of
the Analog Filter Design block to the fourth input to the scope. Don’t
forget to change the layout of the scope to 4 rows.
If you couldn’t configure the model by following the previous indications,
you can open the PAM_demod.slx model.

Practical assgnments:
4. Run the simulation and compare the demodulated signal (fourth plot)
with the original message. You should get the same result as in Fig.
4.7. Is the reconstructed waveform identical to the original? What
about the amplitude?
8 INTRODUCTION TO DIGITAL COMMUNICATIONS

Fig. 4.7 PAM demodulation (waveforms)

Practical assgnments:
5. Go to the parameters of the Pulse generator block and change the pulse
width to 5% and repeat the simulation. Keep an eye on the
reconstructed signal. Now change the pulse width to 75%. What
happens to the demodulated signal amplitude? Can you explain why?
6. Now set the pulse width back to 25% and repeat the simulation, this
time by changing the message signal frequency to: 1500, 2000, 2200
KHZ. What happens this time?
7. Set the message signal frequency back to 1KHz and add an Averaging
Power Spectral Density block (from the Library Browser) and set its
buffer length to 1024, No. of fft points to 4096, plot after 64 points,
sample time 8e-6. Change the simulation time from 2 to 12 ms.
Connect the input of this block to the output of the sampler and run the
simulation. Can you identify the original message signal, and the first
DSB replica?
ANALOG AND DIGITAL COMMUNICATIONS – LAB. 4 9

Practical assgnments:
8. Change the analog filter design type to Bandpass, and the lower and
upper edge frequencies to 2*pi*8000 and 2*pi*12000 and run the
simulation. What can you say about the waveform of the signal you
obtain after this filtering stage? Is it a baseband or a modulated signal?
If it is modulated, what would the carrier frequency be?

Now open the PAM_SH.slx model file, also depicted in Fig. 4.8. The
model is similar to the previous, the only difference being the block usedfor
sampling. This time, we use a sample&hold method.

Fig. 4.8 PAM Modulator (sample/hold method)

Practical assgnments:
9. Repeat steps 2-7 with the sample/hold model and and compare the
results.
10 INTRODUCTION TO DIGITAL COMMUNICATIONS

4.4 PWM signal generation

To generate a PWM signal, one has to compare the message signal with an
carrier signal, that is typically a triangle (or sawtooth) waveform with the
frequency greater (10 times or more) that the message signal frequency.
Question: Why do we typically generate a PWM signal by comparing the
message signal with a triangle waveform?
Hence, for this exercise we are going to create, in Simulink, a model that has a
repeating triangle sequence block with the frequency 10 time higher than the
message signal, sine wave) waveform. We are going to compare this triangle
sequence with the sinewave and the resulting signal should be the PWM signal.
For this part of the lab load the PWM.slx model, Figure 4.8. In the model we
have a Repeating sequence that we use to generate the triangle waveform. The
frequency of the triangle waveform is 104 Hz and the amplitude of 1V. The
Message signal is a sine wave with a frequency of 103 Hz and amplitude of 0.9

Fig. 4.8 PWM Simulink Model

V.

Run the PWM.slx simulink model for 1ms and configure the model
configuration parameters to a Fixed Step Solver with a Fundamental Sample
time of 2e-6. In Figure 4.9 the output of the PWM Simulink Model is presented.
Question: Explain the PWM model waveforms from Figure 4.9?
ANALOG AND DIGITAL COMMUNICATIONS – LAB. 4 11

Fig. 4.9 PWM Signal (top), Message Signal (sine wave) and Triangle Wave
(bottom)

Practical assgnments:
9. Increase/Decrease Amplitude of the Message signal. Explain the
results.
10.Increase/Decrease the Frequency of the Message signal. Explain the
results.
11.Increase/Decrease the Frequency of the triangle waveform. Explain the
results.
12.Increase/Decrease Amplitude of the Message signal. Explain the
results.
13.Inverse the triangle waveform (i.e start with the positive peak). Explain
the results.
14.Replace the sine wave block with a Signal Generator block and run the
model for different types of signal. Explain the results
12 INTRODUCTION TO DIGITAL COMMUNICATIONS

4.5 PPM signal generation


For PPM the message signal is encoded in the position of a series of signal
pulses. Hence, the position of a pulse from a periodic pulse train is varieated
acording to the amplitude of the message signal. For PPM, the widith and
amplitude of the pulse are constant.
To generate a PPM signal, one has to compare the message signal with an
carrier signal, that is typically a triangle (or sawtooth) waveform with the
frequency greater (10 times or more) that the message signal frequency. The
result should be inverted and a rising edge detector should be added in order to
create the new pulse signals based on the block’s widith parameter.
Question: What are the differences and similitudes between PPM and PWM?
Hence, for this exercise we are going to create, in Simulink, a model that has a
sawtooth generator bloc with the frequency 10 time higher than the message
signal, generated by the signal generator. We are going to compare the sawtooth
with the message signal and invert the result. Using a Monostable block we are
going to generate pulses with the widith of 5 µs. The resulting signal will be a
PPM signal.

Fig. 4.10 PWM Simulink Model


For this part of the lab load the PPM.slx model, Figure 4.10. In the model we
have a Message signal of 0.9 V amplitude and 103 Hz frequency (sine wave), a
Sawtooth Generator with 1V amplitude 104 Hz frequency and no phase. The
Monostable block, detects the rising edge of an signal and generates a pulse,
ANALOG AND DIGITAL COMMUNICATIONS – LAB. 4 13

starting from the same point as the rising edge of the input signal, with an widith
of 5 µs.
Run the PPM.slx simulink model for 1ms and configure the model configuration
parameters to a Fixed Step Solver with a Fundamental Sample time of 2e-6. In
Figure 4.x the output of the PPM Simulink Model is presented.
Question: Explain the PPM model waveforms from Figure 4.11?

Fig. 4.11 PPM Signal (top), Message Signal (sine wave) and Sawtooth Wave
(bottom)

Practical assgnments:
15.Increase/Decrease Amplitude of the Message signal. Explain the
results.
16.Increase/Decrease the Frequency of the Message signal. Explain the
results.
17.Increase/Decrease the Frequency of the sawtooth waveform. Explain
the results.
18.Increase/Decrease Amplitude of the Message signal. Explain the
results.
19.Is the presented model also a PPM generator? Demonstrate why it is or
why it isn’t.
20.Re-run the Simulink model for other message waveforms. Explain the
results

You might also like