%%%%%%%%%%%%%Last Update, 2 October 2008%%%%%
function eyed_qpsk(iout,qout)
close all
%%%%%%%%plot the eyediagram%%%%%%%%
figure
subplot(2,1,1)
title('Eye diagram of the in-phase component')
hold on
L=length(iout);
for i=16:(L-64)/16;
   m1=(i-1)*16+1;
   m2=(i+1)*16+1;
   plot(iout(m1:m2),'r-')
end
subplot(2,1,2)
title('Eye diagram of the quadrature component')
hold on
L=length(qout);
for i=16:(L-64)/16;
   m1=(i-1)*16+1;
   m2=(i+1)*16+1;
   plot(qout(m1:m2),'r-')
end

%Plot the signal constellation
idata=iout(1:16:end); %Sampling
idata=idata(11:end); % Remove the transient effect 
idata=idata/16; %Normalize
qdata=qout(1:16:end); %Sampling
qdata=qdata(11:end); % Remove the transient effect 
qdata=qdata/16; %Normalize


figure,plot(idata,qdata,'r .'),hold on, grid,shg
plot([1 1 -1 -1],[1 -1 1 -1],'rs','MarkerEdgeColor','k','MarkerFaceColor','g','MarkerSize',8)
title('Signal constellation for a QPSK signal with Gaussian noise')
