load gm.04.txt

G = gm;

hold off
subplot(2,2,1)
semilogy(G(:,2),G(:,3),'k:')
hold on
semilogy(G(:,2),G(:,4),'k-.')
semilogy(G(:,2),G(:,5),'k-')
semilogy(G(:,2),G(:,6),'k--')
axis tight
xlabel 'SNR (dB)'
ylabel 'BER'
title '(a) BER vs. SNR'
hold off

subplot(2,2,3)
plot(G(:,2),G(:,3)-G(:,5),'k:')
hold on
plot(G(:,2),G(:,4)-G(:,5),'k-.')
plot(G(:,2),G(:,6)-G(:,5),'k--')
axis tight
xlabel 'SNR (dB)'
ylabel 'BER - BER0'
title '(b) BER difference'
hold off

subplot(2,2,1);

% [m n] = size(G);
%
% x = G(1,2) + (G(m,2) - G(1,2))/2;
% y = max(max(G(:,3:5)));
% y = 0.75*y;

a = axis;

x = a(1) + (a(2)-a(1))/20;
y = a(3) + (a(4)-a(3))/15;

% x = a(1) + (a(2)-a(1))/2.2;
% y = a(3) + (a(4)-a(3))/2.5;

text(x,y, ['---  Kaleh-Vallet     '; ...
           '.......  deterministic'; ...
           '.-.-. Gauss-Markov    '; ...
           '\_\_\_\_ known channel' ]);
