%=======================================
%===== The Modulated Sine Function =====
%=======================================

clear
clc

Amplitude = 1;
SineFrequencyI = 1;
SineFrequencyII = 20;
Phase = 0;
Duration = 2;
SamplingRate = 300;
AngularFrequencyI = 2*pi*SineFrequencyI;
AngularFrequencyII = 2*pi*SineFrequencyII;
Time = 0:1/SamplingRate:Duration;

SineFunctionI = Amplitude * sin(AngularFrequencyI*Time + Phase);
SineFunctionII = Amplitude * sin(AngularFrequencyII*Time + Phase);

TheModulatedSineFunction = SineFunctionI .* SineFunctionII;

figure(1);
subplot(3,1,1), plot(Time,SineFunctionI);
title(['The Sine Function With A Frequncy Value Equal To: ',int2str(SineFrequencyI)]);
xlabel('Time (Sec)');
ylabel('Amplitude (V)');
grid on

subplot(3,1,2), plot(Time,SineFunctionII);
title(['The Sine Function With A Frequency Value Equal To: ',int2str(SineFrequencyII)]);
xlabel('Time (Sec)');
ylabel('Amplitude (V)');
grid on

subplot(3,1,3), plot(Time,TheModulatedSineFunction);
title('The Modulated Sine Function');
xlabel('Time (Sec)');
ylabel('Amplitude (V)');
grid on