Professional Documents
Culture Documents
To implement the circuit of PAM, PWM and PPM modulator & Demodulator and study
their response on various pulses for modulating signal input of 1 KHz to 2 KHz and pulse
output of 8 KHz to 64 KHz.
2. Task to be done:
THEORY
Pulse Width Modulation (PWM) is a form of pulse modulation where the width of the
pulses in a carrier pulse train is made proportional to the instantaneous amplitude of the
modulating signal. A pulse width modulator circuit made up of 555 Timer is shown in
figure. Here the 555 timer is working in monostable mode. A negative trigger pulse at pin
2 sets the output. The modulating signal is applied to the control pin of the 555 which
varies the threshold voltage. This in turn varies the charging time of capacitor C2 and
makes the trailing edge of the output pulse proportional to the modulating signal. Thus
the leading edge of the output pulse is decided by the trigger pulse which occurs
periodically and the trailing edge is proportional to the amplitude of the modulating
signal. The resulting output will be pulse width modulated. The pulse width demodulator
circuit consists of an integrator and a low pass filter with a cut off frequency of 100Hz.
The integrator reconstructs the modulating signal which is further smoothened by the
low pass filter. The series capacitor eliminates the dc component from the demodulated
signal.
Pulse Position Modulation (PPM) is one of the pulse modulation schemes where the
relative position of the pulses in a carrier pulse train is made proportional to the
instantaneous value of the modulating signal. A pulse position modulator made up of IC
555 is shown in figure. Both the 555s are working in monostable mode. The first
monostable generates a PWM signal and this PWM output is used as the trigger input of
the second monostable. Since the monostable triggers at the trailing edge of the PWM
signal, the position of the resulting pulses will have position shift compared to the input
pulse train. The PPM demodulator is set up using an Op Amp SR flip flop, an integrator
and a low pass filter. The flip flop is set by the carrier pulses and reset by the PPM pulses.
The resulting output is a PWM signal. This PWM signal is then demodulated using the
integrator-low pass filter combination.
CODE
PPM:
clc;
close all;
t = 0:0.02:2;
x1 = 1; %generation of an impulse signal
stem(x1);
title('Impulse Signal');
xlabel('Time');
ylabel('Amplitude ');
plot(t,x2);
title('Sine Wave');
xlabel('Time ');
ylabel('Amplitude ');
stem(t,y);
title('PAM Wave');
xlabel('Time');
ylabel('Amplitude');
clc;
close all;
t=0:0.0001:1;
s=sawtooth(2*pi*10*t+pi);
m=0.75*sin(2*pi*1*t);
n=length(s);
for i=1:n
if (m(i)>=s(i))
pwm(i)=1;
elseif (m(i)<=s(i))
pwm(i)=0;
end
end
plot(t,pwm,'g',t,m,'r',t,s,'b');
ylabel('Amplitude');
xlabel('Time index');
title('PWM Wave');
grid on;
clc;
clear all;
close all;
fc=1000;
fs=10000;
fm=200;
t=0:1/fs:((2/fm)-(1/fs));
X= 0.5*cos(2*pi*fm*t)+0.5;
Y= modulate(X,fc,fs,'PPM');
subplot(2,2,1);
plot(X);
title('Msg Signal');
subplot(2,2,2);
plot(Y);
title('PPM');
PPM:
clc;
close all;
clear all;
a = input('Enter the amplitude = ');
f = input('Enter the frequency = ');
t = 0:0.02:2; % for a total of 16 samples
x1 = 1; %generation of an impulse signal
x2 = a*sin(2*pi*f*t); %generation of sine wave
y = x1.*x2; %modulation step
subplot(3,1,1); %for impulse signal plot
stem(x1);
title('Impulse Signal');
xlabel('Time');
ylabel('Amplitude ');
subplot(3,1,2) %for sine wave plot
plot(t,x2);
title('Sine Wave');
xlabel('Time ');
ylabel('Amplitude ');
PWM
fs=input('Comparator Sawtooth frequency:');
fm=input('Message frequency(Assuming it to be a sine wave):');
a=input('Enter Amplitude of Message:');
subplot(3,1,1);
plot(t,stooth); % plotting the sawtooth wave
title('Comparator Wave');
subplot(3,1,2);
plot(t,msg); %plotting the sine message wave
title('Message Signal');
for i=1:length(stooth)
if (msg(i)>=stooth(i))
pwm(i)=1; %is message signal amplitude at i th sample is greater than
%sawtooth wave amplitude at i th sample
else
pwm(i)=0;
end
end
subplot(3,1,3);
plot(t,pwm,'r');
title('PWM');
axis([0 1 0 1.1]); %to keep the pwm visible during plotting.
11. Graphs (If Any): Image /Soft copy of graph paper to be attached here
PPM
PAM
PWM
Evaluation Grid (To be created as per the SOP and Assessment guidelines by the faculty):