PRINCIPLES OF COMMUNICATION
LABORATORY
ECE102.1
Professor: Engr. Jennibeth Gatal
Undergraduate Student: John Stephen Abadinas
Student ID: 2023-2340
Department of Electronics Engineering
College of Engineering and Technology
MSU-Iligan Institute of Technology
Laboratory Activity Number 4
Pulse Amplitude Modulation (PAM)
Pulse Amplitude Modulation (PAM) is a form of signal modulation where the message
information is encoded in the amplitude of a series of signal pulses. In this laboratory activity, you
will simulate PAM using MATLAB.
Objectives:
1. To understand the concept of Pulse Amplitude Modulation (PAM).
2. To generate a PAM signal using MATLAB.
3. To analyze the PAM signal in both time and frequency domains.
MATLAB Code for PAM Simulation:
% Clear workspace and command window
clear;
clc;
% Parameters
fs = 1000; % Sampling frequency (Hz)
t = 0:1/fs:1-1/fs; % Time vector (1 second duration)
fm = 5; % Message signal frequency (Hz)
fc = 20; % Carrier pulse frequency (Hz)
A = 1; % Amplitude of the message signal
% Message signal (sine wave)
message_signal = A * sin(2 * pi * fm * t);
% Carrier signal (rectangular pulse train)
duty_cycle = 0.5; % Duty cycle of the pulse
carrier_signal = square(2 * pi * fc * t, duty_cycle * 100) > 0;
% PAM signal generation
pam_signal = message_signal .* carrier_signal;
% Plotting the signals
figure;
% Message signal
subplot(3, 1, 1);
plot(t, message_signal, 'b', 'LineWidth', 1.5);
title('Message Signal');
xlabel('Time (s)');
ylabel('Amplitude');
grid on;
% Carrier signal
subplot(3, 1, 2);
plot(t, carrier_signal, 'r', 'LineWidth', 1.5);
title('Carrier Signal (Pulse Train)');
xlabel('Time (s)');
ylabel('Amplitude');
ylim([-0.2 1.2]);
grid on;
% PAM signal
subplot(3, 1, 3);
plot(t, pam_signal, 'm', 'LineWidth', 1.5);
title('PAM Signal');
xlabel('Time (s)');
ylabel('Amplitude');
grid on;
% Frequency domain analysis
figure;
N = length(pam_signal);
f = (-N/2:N/2-1) * (fs/N); % Frequency vector
pam_spectrum = abs(fftshift(fft(pam_signal))) / N;
plot(f, pam_spectrum, 'g', 'LineWidth', 1.5);
title('Frequency Spectrum of PAM Signal');
xlabel('Frequency (Hz)');
ylabel('Magnitude');
grid on;
Steps to Perform the Activity
1. Set Parameters.
a) Define the sampling frequency (`fs`), message signal frequency (`fm`),
and carrier pulse frequency (`fc`).
b) Adjust the amplitude (`A`) and duty cycle of the carrier signal as needed.
2. Generate Message Signal.
Create a sinusoidal message signal using the `sin` function.
3. Generate Carrier Signal.
Use the `square` function to generate a rectangular pulse train as the carrier signal.
4. Generate PAM Signal.
Multiply the message signal with the carrier signal to obtain the PAM signal.
5. Plot Signals.
a) Plot the message signal, carrier signal, and PAM signal in the time domain.
b) Use the Fast Fourier Transform (FFT) to analyze the PAM signal
in the frequency domain.
6. Analyze Results.
a) Observe the PAM signal in the time domain and verify that the amplitude
of the pulses corresponds to the message signal.
b) Analyze the frequency spectrum to understand the bandwidth and
frequency components of the PAM signal.
Results:
Expected Output
1. Time Domain Plots.
a) The message signal will be a smooth sinusoidal wave.
b) The carrier signal will be a rectangular pulse train.
c) The PAM signal will show pulses whose amplitudes follow the message signal.
2. Frequency Domain Plot.
The spectrum of the PAM signal will show the frequency components of the message
signal and the harmonics introduced by the carrier signal.
Questions for Analysis
1. What happens to the PAM signal if you change the duty cycle of the carrier signal?
In Pulse Amplitude Modulation (PAM), changing the duty cycle of the carrier signal
directly changes the width of the sampling pulses. A lower duty cycle produces narrower pulses,
which capture less of the analog signal and may cause distortion or loss of information, though it
reduces power usage. Conversely, a higher duty cycle results in wider pulses that sample more of
the signal, improving accuracy but potentially increasing power consumption and causing pulse
overlap or distortion. Thus, the duty cycle controls the balance between signal quality and power
efficiency in the PAM signal by determining how much of the analog signal is sampled during
each pulse.
2. How does the frequency of the carrier signal affect the PAM signal?
The frequency of the carrier signal in Pulse Amplitude Modulation (PAM) determines
how often the analog signal is sampled. A higher carrier frequency means more frequent
sampling, which can more accurately capture changes in the analog signal, improving the
signal’s resolution and fidelity—provided it stays within the limits of the Nyquist theorem.
However, it also increases bandwidth requirements and processing demands. On the other hand, a
lower carrier frequency results in fewer samples, which may cause loss of detail and distortion if
the signal is undersampled. Therefore, carrier frequency directly affects the clarity, accuracy, and
bandwidth efficiency of the PAM signal.
3. What are the advantages and disadvantages of PAM compared to other modulation techniques?
Advantages of PAM:
- Simplicity: PAM is relatively easy to implement, with straightforward circuitry
for modulation and demodulation.
- Efficient Use of Bandwidth: It can be more bandwidth-efficient than analog
modulation methods like AM and FM.
- Foundation for Digital Modulation: PAM serves as a base for more advanced
schemes like Pulse Code Modulation (PCM) and
Quadrature Amplitude Modulation (QAM).
Disadvantages of PAM:
- Noise Sensitivity: Since signal amplitude carries the information, PAM is
highly vulnerable to noise and distortion, similar to AM.
- Power Inefficiency: Varying amplitudes lead to higher power consumption
and less efficient use of power compared to methods like FM or
phase modulation.
- Poor Long-Distance Performance: It is not ideal for long-distance communication
without further encoding (like in PCM), as noise can significantly
degrade signal quality.
Summary:
PAM is simple and bandwidth-efficient but suffers from noise sensitivity and is not ideal
for long-range or high-reliability communications without additional processing. Other
techniques like PCM offer better noise immunity, while FM is more robust but more complex.