Thursday, June 2, 2016

PULSE AMPLITUDE MODULATION (PAM)

PROGRAM:
clc;
clear all;
close all;
fs = 100;
fm = 1;
%f = input('Enter the signal frequency :');
t=(0:0.05:100)'/fs;
fp = 2;
a = ones(1,length(t));
b = sin(2*pi*t*fm);
y=[];
for i=1:fs/fp:length(t)
    y =  [y,[ones(1,fs/(2*fp)).*b(i),zeros(1,fs/(2*fp))]];   
end
subplot(2,1,1);
plot(t,b);
xlabel('time'),ylabel('amplitude');
title('modulating signal');
subplot(2,1,2)
plot(t,y(1:length(t)));
xlabel('time'),ylabel('amplitude');
title('PAM signal');
axis([0 1 -1 1]);


PLOT:

No comments:

Post a Comment