Nusers = 2;

% asil01_3.diary.01
% Nsyms = 5
% trials = 2000
%
% and SNR=[5 -5]' from asil01_3.diary.02
%
s = [
     5
    -5
        0.021
       0.2092
         0.02
        0.226
    10
     0
       0.0063
       0.1065
       0.0079
       0.1384
    15
     5
       0.0015
       0.0501
       0.0032
       0.0828
    20
    10
       0.0012
       0.0301
       0.0034
       0.0717
    25
    15
       0.0009
       0.0279
       0.0029
        0.066
];

n = length(s)/(Nusers*3);

s = reshape(s,Nusers,3,n);

% s(u,1,:) = SNR
% s(u,2,:) = BER_full
% s(u,3,:) = BER_rsse

snr = s(:,1,:);
snr = snr(:);
snr_min = min(snr);
snr_max = max(snr);

hold off

%%%
%%
% user #1
%
u = 1;

snr = s(u,1,:);
snr = snr(:);

ber_full = s(u,2,:);
ber_full = ber_full(:);

ber_rsse = s(u,3,:);
ber_rsse = ber_rsse(:);

subplot(2,2,1)

semilogy(snr,ber_rsse,'--x');
hold on
semilogy(snr,ber_full,'-*');

%%%
%%
% user #2
%
u = 2;

snr = s(u,1,:);
snr = snr(:);

ber_full = s(u,2,:);
ber_full = ber_full(:);

ber_rsse = s(u,3,:);
ber_rsse = ber_rsse(:);

semilogy(snr,ber_rsse,'--x');
semilogy(snr,ber_full,'-*');

a = axis;
axis([snr_min snr_max a(3) a(4)])

legend('RSSE','Full', 3)

xlabel 'SNR'
ylabel 'BER'
title 'BER vs. SNR for Full Trellis and RSSE'

grid on
