t=0:0.01:1-0.01;
b1=sqrt(2)*cos(2*pi*t*5);
b2=sqrt(2)*sin(2*pi*t*5);
data=randint(1,2000,[0 1],1);
sp=reshape(data*2[]);
map=sp*2-1;
mapI=map(1,:);
mapQ=map(2,:);
qpskI=b1'*mapI;
qpskI=b2'*mapQ;
qpsk=qpskI+qpskQ;
qpskTx=reshape(qpsk,1,[]);
spek=ft(qpskTx,2^17);
f=0:2^17-1;
figure
plot(f,abs(spek))
axis([0 14000 0 8000])
figure
tx=0:length(qpskTx)-1;tx=tx/100;
figure
plot(tx,qpskTx)
r=awgn(qpskTx,-5);
figure
plot(tx,r);
qpskRx=reshape(r,100,[]);
z1=b1*qpskRx/100;
z2=b2*qpskRx/100;
dz1=sign(z1)
dz2=sign(z2)
figure
subplot(2,1,1)
plot(z1,z2,'r*')
axis([-2 2 -2 2])
subplot(2,1,2)
y=zeros(size(z1));
figure
plot(z1,y,'ro')
axis([-2 2 -2 2])
figure
hist(z1,100)