fs=400;
fo=5;
fc=25;
num_periods=40;
samp_period=(fs/fo);
totalsamp=samp_period*num_periods;
n=[0:totalsamp-1];
t=(n/fs);
m=sin(2*pi*fo*t);
N=totalsamp;
M=abs(fft(m,N))/totalsamp;
M=fftshift(M);
F=[-N/2:(N/2)-1];
Ac=1;
Ka=0;
DCoffset=1;
s=Ac*(DCoffset+Ka*m).*cos(2*pi*fc*t);
S=abs(fft(s,N))/totalsamp;
S=fftshift(S);
close all;
F2=figure;
subplot(3,1,1);
plot(t,s,t,(DCoffset+Ka*m),'--'),grid;
Maxtime=5*samp_period/fs;
xlabel('time(ms)');
subplot(3,1,2);
plot(F,M)
xlabel('frequency(khz)');
subplot(3,1,3);
plot(F,s)
You may like Digital Modulation Techniques now you are at analog modulation
0. Frequency Modulation
1. Amplitude shift keying
2. Frequency shift keying
3. Phase shift keying
4. Hybrid Shift Keying