You are on page 1of 1

clear;

clc;
close;

f=5;
t=0:1/1000:1;
x=sin(2*3.14*f*t);
I=[0,1,1,0,1,0,0,1];

Xpsk=[];
x1=sin(2*3.14*f*t);
x2=-sin(2*3.14*f*t);

for n=1:length(I)
if(I(n)==1)
Xpsk=[Xpsk,x1];
elseif(I(n)~=1)
Xpsk=[Xpsk,x2];
end
end

subplot(3,1,1); plot(I); xtitle('Message signal'); xgrid;


subplot(3,1,2); plot(x); xtitle('Analog Carrier Signal For Digital Modulation');
xgrid;
subplot(3,1,3); plot(Xpsk); xtitle('Phase Shift Keying'); xgrid;

You might also like