%Phase shift keying
clc;
clear all;
close all;
s=[1 0 1 0];
f1=10;
a=length(s);
for i=1:a
if s(1,i)==1
freq=f1*s(1,i);
for t= (i-1)*100+1:i*100
x(t)= sin(2*pi*freq*t/1000);
end
elseif s(1,i)==0
b=(2*s(1,i))+1;
freq=f1*b;
for t=(i-1)*100+1:i*100
x(t)= sin((2*pi*freq*t/1000)+pi);
end
end
end
plot(x);
xlabel('title in secs');
ylabel('amplitude in volts')
title ('PSK')
grid on
OUTPUT:
clc;
clear all;
close all;
s=[1 0 1 0];
f1=10;
a=length(s);
for i=1:a
if s(1,i)==1
freq=f1*s(1,i);
for t= (i-1)*100+1:i*100
x(t)= sin(2*pi*freq*t/1000);
end
elseif s(1,i)==0
b=(2*s(1,i))+1;
freq=f1*b;
for t=(i-1)*100+1:i*100
x(t)= sin((2*pi*freq*t/1000)+pi);
end
end
end
plot(x);
xlabel('title in secs');
ylabel('amplitude in volts')
title ('PSK')
grid on
OUTPUT:
No comments:
Post a Comment