You are on page 1of 1

clc;

clear all;
close all;
fc =100;
fm =10;
A=input('Enter the amplitude of Message: ');
K=input('Enter the amplitude of Carrier: ');
x=A+K;
wm = 2*3.14*fm;
wc = 2*3.14*fc;
a=[];
for t=0:0.001:1
am = (A*cos(wm*t))*(cos(wc*t))+K*(cos(wc*t));
a=[a am];
end
t=0:0.001:1;
m = A*cos(wm*t);
c = K*cos(wc*t);
subplot(3,1,1);
plot(t,m);
xlabel('Time');
ylabel('Amplitude');
title('Message Signal');
grid on; axis([0 1 -x +x])
subplot(3,1,2);
plot(t,c);
xlabel('Time');
ylabel('Amplitude');
title('Carrier Signal');
grid on; axis([0 1 -x +x])
subplot(3,1,3);
plot(t,a);
xlabel('Time');
ylabel('Amplitude');
title('AM Signal');
grid on; axis([0 1 -x +x])

You might also like