0% found this document useful (0 votes)
3 views

DC 3

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

DC 3

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Digital Communications(EC3144)

Lab Report

October 21, 2024

Name: Gauravendra Chaudhary


Roll No: 220102077
Section: D
Branch: Electronics and Communication Engineering

1 Objective
PAM Signal Generation and Spectra Analysis

Introduction
Pulse Amplitude Modulation (PAM) is a modulation technique in which the
amplitude of discrete pulses is directly proportional to the instantaneous value
of the message signal. In this experiment, we generate a PAM signal from a
continuous-time sinusoidal signal and analyze its spectral characteristics using
Fourier Transform techniques. Our primary focus is on flat-top sampling, a
method where the sampled signal remains constant for a specified duration,
allowing for effective signal representation while minimizing the effects of
sampling-induced distortion.

Theory
Pulse Amplitude Modulation (PAM) is a modulation technique where the
amplitude of pulses is modulated according to the message signal. It is also
referred to as flat-top sampling due to the shape of the pulses. In PAM, the
signal is sampled at discrete intervals, and each sample is held constant for a
duration T . The PAM signal can be obtained by sampling the continuous-time
message signal m(t) at times kTs and holding the sample value constant for a

1
time duration of T . This technique is also known as sample-and-hold
modulation.
The mathematical representation of the PAM signal is:

X
mp (t) = m(kTs )p(t − kTs )
k=−∞

where: - p(t) is the pulse shape, typically a rectangular pulse with duration T ,
- m(kTs ) is the sample value of the message signal at time kTs .
The rectangular pulse p(t) is defined as:
(
1 0≤t≤T
p(t) =
0 otherwise

Thus, the PAM signal can be expressed as the sum of samples m(kTs ), each
held constant for a period T .
In the frequency domain, the Fourier transform of the PAM signal is:

X
Mp (f ) = T fs · M (f − kfs ) · sinc(f T ) · e−jπf T
k=−∞

where: - M (f ) is the spectrum of the sampled message signal, representing the


repetition of the original message spectrum at multiples of the sampling
frequency fs , - P (f ) = T · sinc(f T ) · e−jπf T is the Fourier transform of the
rectangular pulse p(t).

Data and Observations


The parameters used in this experiment are as follows:
• Message signal frequency (fm ): 5 Hz
• Sampling frequency (fs ): 100 Hz

• Pulse duration (T ): 0.005 seconds


• Time range: 0 to 1 second

Observations
• PAM Signal Generation: The PAM signal was obtained by sampling
the sinusoidal signal at regular intervals and holding each sample
constant for a finite duration.
• Pulse Shape and Duration: A rectangular pulse with duration
T = 0.005 seconds was used, resulting in a flat-top sampled signal.

2
• Frequency Domain Analysis: The Fourier transform of the PAM
signal showed the repetition of the message signal spectrum at multiples
of fs .
• Effect of Pulse Duration: Shorter pulse durations resulted in a wider
sinc function in the frequency domain, affecting the shape of the PAM
signal’s spectrum.

Octave Code
The Octave code used for generating the PAM signal and analyzing its spectra
is shown below:
% Octave code for PAM signal generation
clc ; close all ; clear all ;

% Specifications
fm = 5; % Message signal frequency in Hz
fs = 100; % Sampling frequency in Hz
Ts = 1/ fs ; % Sampling period
T = 0.005; % Pulse duration
t = linspace (0 , 1 , 1000) ; % Continuous time vector

% Message signal
mt = cos (2* pi * fm * t ) ;

% Sampling the message signal


n = 0: Ts :1;
m_sampled = cos (2* pi * fm * n ) ;

% Pulse shape ( rectangular pulse of duration T )


p_t = @ ( t ) (t >=0) & (t < T ) ;

% Generate PAM signal


m_pam = zeros ( size ( t ) ) ;
for i =1: length ( n )
m_pam = m_pam + m_sampled ( i ) * p_t (t - n ( i ) ) ;
end

% Fourier transforms and plotting


N = length ( t ) ;
f = ( - N /2: N /2 -1) *( fs / N ) ; % Frequency vector
M_f = abs ( fftshift ( fft ( mt ) / N ) ) ; % FFT of message
signal
Pulse_f = abs ( fftshift ( fft ( p_t ( t ) ) / N ) ) ; % FFT of pulse

3
M_pam_f = abs ( fftshift ( fft ( m_pam ) / N ) ) ; % FFT of PAM
signal

% Plotting
subplot (321) ; plot (t , mt , ’ LineWidth ’ , 1.5) ;
title ( ’ Message Signal ’) ;
xlabel ( ’ Time ( s ) ’) ;
ylabel ( ’ Amplitude ’) ;

subplot (323) ;
stem (n , m_sampled , ’ LineWidth ’ , 1.5) ;
title ( ’ Sampled Signal ’) ;
xlabel ( ’ Time ( s ) ’) ;
ylabel ( ’ Amplitude ’) ;

subplot (325) ; plot (t , m_pam , ’ LineWidth ’ , 1.5) ;


title ( ’ PAM Signal ’) ;
xlabel ( ’ Time ( s ) ’) ;
ylabel ( ’ Amplitude ’) ;

subplot (322) ;
plot (f , M_f , ’ LineWidth ’ , 1.5) ;
title ( ’ Spectrum of Message Signal ’) ;
xlabel ( ’ Frequency ( Hz ) ’) ;
ylabel ( ’ Magnitude ’) ;

subplot (324) ; plot (f , Pulse_f , ’ LineWidth ’ , 1.5) ;


title ( ’ Spectrum of Pulse ’) ;
xlabel ( ’ Frequency ( Hz ) ’) ;
ylabel ( ’ Magnitude ’) ;

subplot (326) ; plot (f , M_pam_f , ’ LineWidth ’ , 1.5) ;


title ( ’ Spectrum of PAM Signal ’) ;
xlabel ( ’ Frequency ( Hz ) ’) ;
ylabel ( ’ Magnitude ’) ;

Results
The generated plots and spectra demonstrate the PAM signal, its frequency
domain analysis, and the effect of the pulse shape on the spectra.

4
Figure 1: Impulse Train, Continuous Sinusoidal Signal, and Sampled Signal

Conclusion
The experiment highlights the generation of a flat-top PAM signal and its
spectral analysis. The Fourier transform of the PAM signal shows the
repetition of the message signal spectrum at multiples of the sampling
frequency. The sinc function shape resulting from the pulse affects the spectral
components of the PAM signal.
In real life, PAM is used in various applications such as:
• Telecommunications: PAM is used in digital transmission systems,
including Ethernet and certain fiber optic communication systems.

• LED Displays: In pulse-width modulation (PWM), a form of PAM, the


brightness of LEDs is controlled by modulating the amplitude of pulses.
• Audio Signal Processing: PAM plays a role in transmitting audio
signals, especially in systems where signals are sampled at regular
intervals for encoding and transmission.

Overall, flat-top PAM is a viable method for signal modulation, with its
characteristics governed by the sampling frequency and pulse duration. It
finds applications in numerous real-world systems, making it an essential
technique in modern communication and electronic devices.

You might also like