MATLAB Code (2)
MATLAB Code (2)
% Parameters
m = 1; % Modulation index or Modulation Factor or Modulation depth
Am = 5; % Amplitude of modulating signal
fm = 2000; % Frequency of modulating signal (Hz)
Tm = 1 / fm; % Period of modulating signal (s)
t = 0:Tm/999:6*Tm; % Time vector for 6 periods of the modulating
signal
Ac = Am / m; % Amplitude of carrier signal
fc = fm * 10; % Frequency of carrier signal (10 times the modulating
signal frequency)
Tc = 1 / fc; % Period of carrier signal (s)
% Modulating Signal
Ym = Am * sin(2 * pi * fm * t); % Modulating (message) signal
subplot(3,1,1); % Create the first subplot
plot(t, Ym, 'b', 'LineWidth', 0.8); % Blue line with thicker width for
better visibility
title('Modulating Signal');
xlabel('Time (s)');
ylabel('Amplitude');
grid on;
% Carrier Signal