Professional Documents
Culture Documents
C Sai Bhavana CSlab Matlab3
C Sai Bhavana CSlab Matlab3
WARANGAL
THEORY:
Pulse amplitude modulation is a technique in which the amplitude of each pulse is
controlled by the instantaneous amplitude of the modulation signal. It is a modulation system
in which the signal is sampled at regular intervals and each sample is made proportional to
the amplitude of the signal at the instant of sampling. This technique transmits the data by
encoding in the amplitude of a series of signal pulses.
Demodulation of PAM
For the demodulation of the PAM signal, the PAM signal is fed to the Low Pass Filter. The
low pass filter eliminates the high-frequency ripples and generates the demodulated signal.
This signal is then applied to the inverting amplifier to amplify its signal level to have the
demodulated output with almost equal amplitude with the modulating signal.
Pulse Modulation is mainly used for transmitting analog data like data otherwise continuous
speech signal.
Matlab Code:
Ideal Sampling:
% Ideal Sampling PAM
clc;
close all;
clear all;
a = 4;
f = 1;
t = 0:0.02:2;
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 ');
subplot(3,1,3) %for PAM wave plot
stem(t,y);
title('PAM Wave');
xlabel('Time');
ylabel('Amplitude');
Output Graphs:
Natural Sampling:
Theory:
Pulse Width Modulation (PWM) encodes a signal into periodic pulses of equal magnitude but
varying width. The width of a pulse at a given point of time is proportional to the amplitude
of the message signal at that time. For example large value of the message yields a narrow
pulse.
To implement the PWM, the message signal is compared with the saw tooth carrier. When
the message signal is greater than the carrier, the comparator output becomes high band vice
versa; the heights and the lows can be represented by +1 and -1 respectively. The comparator
output will be the pulse width modulated signal.
Uses:
Pulse Width Modulation (PWM) is a nifty current control technique that enables you to
control the speed of motors, heat output of heaters, and much more in an energy-efficient
(and usually quieter) manner. Existing applications for PWM include, but are not limited to:
LED Dimmers.
Matlab Code:
% PWM Signal
clc;
close all;
clear all;
t=0:0.0001:1;
s=sawtooth(2*pi*10*t+pi);
figure(1)
subplot(2,1,1);
plot(t,s);
title('sawtooth Signal');
xlabel('Time Period');
ylabel('Amplitude');
m=0.75*sin(2*pi*1*t);
subplot(2,1,2);
plot(t,m);
title('Message Signal');
xlabel('Time Period');
ylabel('Amplitude');
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
figure(2)
plot(t,pwm);
ylabel('Amplitude');
axis([0 1 -1.5 1.5]);
xlabel('Time index');
title('PWM Wave');
grid on;
Output Graphs:
A modulation technique that allows variation in the position of the pulses according to the
amplitude of the sampled modulating signal is known as Pulse Position Modulation (PPM). It
is another type of PTM, where the amplitude and width of the pulses are kept constant and
only the position of the pulses is varied.
Simply put, the pulse displacement is directly proportional to the sampled value of the
message signal.
Matlab Code:
% PPM Signal
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);
axis([0 500 -0.2 1.2]);
title('PPM');
Output Graphs: