clear;
close all;
%PARAMETERS
fc=200; % carrier frequency in hertz
t0=0.15; %time range in seconds
Df=50; %frequency deviation constant in hertz/volt
ts=0.0005; % sampling interval
t=[0:ts:t0]; % time vector
%MESSAGE SIGNAL
m=[2*ones(1,t0/(3*ts)),-3*ones(1,t0/(3*ts)),ones(1,t0/(3*ts)+1)];
figure(1)
hold on
plot(m,'black');
title('Message signal');
xlabel('time');
ylabel('signal value');
set(1,'PaperPositionMode','auto');
%FM SIGNAL
fi=fc+Df*m;
s=cos(2*pi*fi.*t);
plot(s,'red');
title('FM signal');
xlabel('time');
ylabel('signal value');
hleg=legend('message signal','FM signal')
You may like Digital Modulation Techniques now you are at analog modulation
0. Amplitude Modulation AM
1. Amplitude shift keying ASK
2. Frequency shift keying FSK
3. Phase shift keying PSK
close all;
%PARAMETERS
fc=200; % carrier frequency in hertz
t0=0.15; %time range in seconds
Df=50; %frequency deviation constant in hertz/volt
ts=0.0005; % sampling interval
t=[0:ts:t0]; % time vector
%MESSAGE SIGNAL
m=[2*ones(1,t0/(3*ts)),-3*ones(1,t0/(3*ts)),ones(1,t0/(3*ts)+1)];
figure(1)
hold on
plot(m,'black');
title('Message signal');
xlabel('time');
ylabel('signal value');
set(1,'PaperPositionMode','auto');
%FM SIGNAL
fi=fc+Df*m;
s=cos(2*pi*fi.*t);
plot(s,'red');
title('FM signal');
xlabel('time');
ylabel('signal value');
hleg=legend('message signal','FM signal')
You may like Digital Modulation Techniques now you are at analog modulation
0. Amplitude Modulation AM
1. Amplitude shift keying ASK
2. Frequency shift keying FSK
3. Phase shift keying PSK