load eye_data t0 = T*fs; % Number of samples per period grid on; clf; t = [0:length(z_nrz)-1]/t0; c = cos(2*pi*t); s = sin(2*pi*t); Znrz = reshape(z_nrz(t0/2+1:end-t0/2),t0,(length(z_nrz)-t0)/t0); subplot(211);plot(t(1:40*t0),z_nrz(1:40*t0)); grid on; hold on; plot(t(1:t0:40*t0),z_nrz(1:t0:40*t0),'or'); hold off; xlabel('Time (sec)'); title('Matched Filter Output (Samples in Red Circles)'); subplot(223);plot(t(1:t0)-T/2,Znrz); grid on; title('Eye Diagram'); xlabel('Time (sec)'); subplot(224);plot3(c(1:40*t0),s(1:40*t0),z_nrz(1:40*t0)); grid on; title('Cylindrical Eye Diagram'); print -djpeg95 -r75 eye_stuff_nrz.jpg t = [0:length(z_rtrc)-1]/t0; c = cos(2*pi*t); s = sin(2*pi*t); Zrtrc = reshape(z_rtrc(t0/2+1:end-t0/2),t0,(length(z_rtrc)-t0)/t0); subplot(211);plot(t(1:40*t0),z_rtrc(1:40*t0)); grid on; hold on; plot(t(1:t0:40*t0),z_rtrc(1:t0:40*t0),'or'); hold off; xlabel('Time (sec)'); title('Matched Filter Output (Samples in Red Circles)'); subplot(223);plot(t(1:t0)-T/2,Zrtrc); grid on; title('Eye Diagram'); xlabel('Time (sec)'); subplot(224);plot3(c(1:40*t0),s(1:40*t0),z_rtrc(1:40*t0)); grid on; title('Cylindrical Eye Diagram'); print -djpeg95 -r75 eye_stuff_rtrc.jpg