MATLAB Script Simulating The Modulating and Demodulation of An AM Wave
MATLAB Script Simulating The Modulating and Demodulation of An AM Wave
% Modulation Process
Fc = 20; % carrier frequency of 20 kHz
Fs = 160; % sampling rate of 160 samples per ms
Fm = 0.4; % modulating frequency of 0.4 kHz
t = 0:1/Fs:10; % t of 10 seconds
c = cos(2*pi*Fc*t); % carrier signal
m = cos(2*pi*Fm*t); % modulating signal
s = c + 0.25*cos(2*pi*(Fc+Fm)*t) + 0.25*cos(2*pi*(Fc-Fm)*t); % FCAM 50%
mod
dsb_sc = ammod(m,Fc,Fs); % DSB-SC signal
figure;
subplot(4,1,1);
plot(t, m);
title('Modulating Signal'); xlabel('time (s)'); ylabel('amplitude');
subplot(4,1,2);
plot(t, c);
title('Carrier Signal'); xlabel('time (s)'); ylabel('amplitude');
subplot(4,1,3);
plot(t, s);
title('FCAM Signal'); xlabel('time (s)'); ylabel('amplitude');
subplot(4,1,4);
plot(t, dsb_sc);
title('DSB-SC Signal'); xlabel('time (s)'); ylabel('amplitude');