You are on page 1of 2

clc;

clear all;
b = input('Enter the bit stream = ');
n = length(b);
t = 0:0.01:n;
x = 1:1:(n+1)*100;
for i = 1:n
if (b(i) == 0)
u(i) = -1;
else
u(i) = 1;
end
for j = i:0.1:i+1
bw(x(i*100:(i+1)*100)) = u(i);
end
end
bw = bw(100:end);
wo = 2*(2*pi*t);
W = 1*(2*pi*t);
sinHt = sin(wo+W);
sinLt = sin(wo-W);
st = sin(wo+(bw).*W);
subplot(4,1,1);
plot(t,bw);
xlabel('n ---->');
ylabel('Amplitude ---->');
title('Input Bit Stream');
grid on ;
axis([0 n -2 +2]);
subplot(4,1,2);
plot(t,sinHt);
xlabel('Time ---->');
ylabel('Amplitude ---->');
title('Carrier Wave 1');
grid on ;
axis([0 n -2 +2]);
subplot(4,1,3);
plot(t,sinLt);
xlabel('Time ---->');
ylabel('Amplitude ---->');
title('Carrier Wave 2');
grid on ;
axis([0 n -2 +2]);
subplot(4,1,4);
plot(t,st);
xlabel('Time ---->');
ylabel('Amplitude ---->');
title('BFSK Wave');
grid on ;
axis([0 n -2 +2]);

Enter the bit stream = [0 1 1 0 1 0 0 0]


Amplitude ----> Amplitude ----> Amplitude ----> Amplitude ---->
Input Bit Stream
2
0
-2
0 1 2 3 4 5 6 7 8
n ---->
Carrier Wave 1
2
0
-2
0 1 2 3 4 5 6 7 8
Time ---->
Carrier Wave 2
2
0
-2
0 1 2 3 4 5 6 7 8
Time ---->
BFSK Wave
2
0
-2
0 1 2 3 4 5 6 7 8
Time ---->

You might also like