CODE FOR AM MODULATION ON MATLAB

clear all;
close all;
fm=input('Enter the modulating signal:');
fc=input('Enter the carrier signal:');
m=input('Enter the modulation index:');
t=0:0.01:10;
A=cos(6.28*fm*t);
B=cos(6.28*fc*t);
C=(1+m*A).*B;
subplot(3,1,1);
plot(t,A);
xlabel('Time');
ylabel('Amplitude');
title('Modulating Signal');
subplot(3,1,2);
plot(t,B);
xlabel('Time');
ylabel('Amplitude');
title('Carrier Signal');
subplot(3,1,3);
plot(t,C);
xlabel('Time');
ylabel('Amplitude');
title('Modulated Signal');

*********OUTPUT********




Previous Post Next Post