% known channel from asil01_2.diary, RSSE L=3

SNR_array = [
     5    10    15
    -5     0     5
];

BER_full = [
       0.0034
       0.1664
       0.0006
         0.04
   0.00013333
    0.0028667
];

BER_rsse = [
       0.0044
       0.1812
       0.0009
       0.0448
       0.0002
       0.0035333
];

n = size( SNR_array, 2);

snr = SNR_array(:);
snr_min = min(snr);
snr_max = max(snr);

hold off

%%%
%%
% user #1
%
snr = SNR_array(1,:);
ber_full = BER_full(1:2:2*n);
ber_rsse = BER_rsse(1:2:2*n);

subplot(2,2,1)

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

%%%
%%
% user #2
%
snr = SNR_array(2,:);

ber_full = BER_full(2:2:2*n);
ber_rsse = BER_rsse(2:2:2*n);

semilogy(snr,ber_rsse,'--o');
semilogy(snr,ber_full,'-d');

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

legend('#1 RSSE','#1 Full', '#2 RSSE', '#2 Full', 1)

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

grid on
