You are on page 1of 1

clc;

clear all;
m = input('Enter the input bits: ');
n = length(m);
t = 0:0.01:n;
x = 1:1:(n+1)*100;
for i = 1:n
for j = i:.1:i+1
sq(x(i*100:(i+1)*100)) = m(i);
end
end
sq = sq(100:end);
c = sin(2*pi*t);
ask = sq.*c;
%Modulation
%Plotting
subplot(3,1,1)
plot(t,sq)
grid on ; axis([0 n -2 +2])
subplot(3,1,2)
plot(t,c)
grid on ; axis([0 n -2 +2])
subplot(3,1,3)
plot(t,ask)
grid on ; axis([0 n -2 +2])

%[0 1 0 1 1 0 0]

You might also like