FSK Modulation Matlab Programming: All All
FSK Modulation Matlab Programming: All All
clc;
clear all;
close all;
T=1;fc=10;fs=25;
t=0:T/100:1;
c=sqrt(2/T)*sin(2*pi*fc*t);
d=sqrt(2/T)*sin(2*pi*fs*t);
N=8;
m=rand(1,N);
t1=0;t2=T;
for i=1:N
t=[t1:.01:t2]
if m(i)>0.5
m(i)=1;
m_s=ones(1,length(t));
fsk_sig(i,:)=c;
else
m(i)=0;
m_s=zeros(1,length(t));
fsk_sig(i,:)=d;
end
message(i,:)=m_s;
t1=t1+(T+.01);
t2=t2+(T+.01);
subplot(5,1,2);
axis([0 N -2 2]);
plot(t,message(i,:),'r');
title('message signal');
xlabel('t--->');
ylabel('m(t)');
grid on
hold on
subplot(5,1,4);
plot(t,fsk_sig(i,:));
title('FSK SIGNAL');
xlabel('t--->');
ylabel('s(t)');
grid on
hold on
end
hold off
subplot(5,1,3);
plot(t,c);
title('carrier signal');
xlabel('t--->');
ylabel('c(t)');
grid on
subplot(5,1,1);
stem(m);
title('binary data bits');
xlabel('n--->');
ylabel('b(n)');
grid on
OUTPUT :
0.5
0
1 2 3 4 5 6 7 8
n--->
message signal
2
m(t)
0
-2
0 1 2 3 4 5 6 7 8
t--->
carrier signal
2
c(t)
-2
7 7.2 7.4 7.6 7.8 8 8.2
t--->
FSK SIGNAL
2
s(t)
-2
0 1 2 3 4 5 6 7 8 9
t--->