In: Electrical Engineering
Part 1. Single-tone Modulation a –Write the code for an m-file (script) to generate a single tone FM signal. The modulating (message) signal is a single tone signal with frequency 1kHz and the carrier frequency is 20kHz. Vary the modulation index as m=0.2; 0.5; 1; 5 and 10. Plot your original message signal and the modulated signal for each value of m. Discuss the results. Use cosine function to define the message signal.
b- Repeat the part above only that this time generate a single tone PM signal. Compare the plots in parts a and b.
%single tone FM signal
clc
clear all
close all
t=0:pi/100:2*pi;
fc=20000;
fm=1000;
m=0.2;
AC=input('enter carrier signal amplitude');
s=AC*(cos(2*pi*fc*t+m.*cos(2*pi*fm*t)));
subplot(3,2,1);
plot(t,s);
title('FM modulation when m=0.2');
xlabel('time');
ylabel('modulated signal');
%moduation indesm=0.5
t=0:pi/100:2*pi;
m=0.5;
s=AC*(cos(2*pi*fc*t+m.*cos(2*pi*fm*t)));
subplot(3,2,2);
plot(t,s);
title('FM modulation when m=0.5');
xlabel('time');
ylabel('modulated signal');
%modulation index m=1
t=0:pi/100:2*pi;
m=1;
s=AC*(cos(2*pi*fc*t+m.*cos(2*pi*fm*t)));
subplot(3,2,3);
plot(t,s);
title('FM modulation when m=1');
xlabel('time');
ylabel('modulated signal');
%modulation index m=5
t=0:pi/100:2*pi;
m=5;
s=AC*(cos(2*pi*fc*t+m.*cos(2*pi*fm*t)));
subplot(3,2,4);
plot(t,s);
title('FM modulation when m=5');
xlabel('time');
ylabel('modulated signal');
%modulation index m=10
t=0:pi/100:2*pi;
m=10;
s=AC*(cos(2*pi*fc*t+m.*cos(2*pi*fm*t)));
subplot(3,2,5);
plot(t,s);
title('FM modulation when m=10');
xlabel('time');
ylabel('modulated signal');
%PM signal
clc
clear all
close all
t=0:pi/100:2*pi;
fc=20000;
fm=1000;
%modulation index m=0.2
m=0.2;
AC=input('enter carrier signal amplitude');
s=AC*(cos(2*pi*fc*t+m.*sin(2*pi*fm*t)));
subplot(3,2,1);
plot(t,s);
title('PM modulation when m=0.2');
xlabel('time');
ylabel('modulated signal');
%moduation index m=0.5
t=0:pi/100:2*pi;
m=0.5;
s=AC*(cos(2*pi*fc*t+m.*sin(2*pi*fm*t)));
subplot(3,2,2);
plot(t,s);
title('PM modulation when m=0.5');
xlabel('time');
ylabel('modulated signal');
%modulation index m=1
t=0:pi/100:2*pi;
m=1;
s=AC*(cos(2*pi*fc*t+m.*sin(2*pi*fm*t)));
subplot(3,2,3);
plot(t,s);
title('PM modulation when m=1');
xlabel('time');
ylabel('modulated signal');
%modulation index m=5
t=0:pi/100:2*pi;
m=5;
s=AC*(cos(2*pi*fc*t+m.*sin(2*pi*fm*t)));
subplot(3,2,4);
plot(t,s);
title('PM modulation when m=5');
xlabel('time');
ylabel('modulated signal');
%modulation index m=10
t=0:pi/100:2*pi;
m=10;
s=AC*(cos(2*pi*fc*t+m.*sin(2*pi*fm*t)));
subplot(3,2,5);
plot(t,s);
title('PM modulation when m=10');
xlabel('time');
ylabel('modulated signal');