clc;
clear all;
close all;
Ac = 2;        % carrier amplitude
fc = 0.5;      % carrier frequency
Am = 0.5;      % message signal amplitude
fm = 0.05;     % message signal frequency
Fs = 100;      % sampling rate/frequency
ka = 1;        % Amplitude Sensitivity
t = [0:0.1:50];              % time range in steps of 0.1
ct = Ac * cos(2 * pi * fc * t);    % carrier signal
mt = Am * cos(2 * pi * fm * t);    % message signal
AM = ct .* (1 + ka * mt);          % amplitude modulated signal
subplot(3,1,1);           % Message signal
plot(mt);
ylabel('Message signal');
subplot(3,1,2);           % Carrier signal
plot(ct);
ylabel('Carrier');
subplot(3,1,3);           % AM signal
plot(AM);
ylabel('AM signal')
sgtitle('Sujal Singh (04119051723)')
exportgraphics(fig, '1.pdf', 'ContentType', 'vector');
