
% This script runs MLSE for the asymmetric channel impulse response

N=1000; % Block size of data
block_num=1000;
snr=4:1:16;

C1=[0.3162 1 0.3162];
C2=[0.2 1 0.3162 -0.2 0.1 -0.05 0.02];
C3=[-0.3920  0.0152  0.8320  0.0152  -0.3920]
%C=C1;
C=C2;

C=C/norm(C);

tic

for snr_index=1:length(snr),

snr(snr_index)

for iter=1:block_num,

% terminal output
      fprintf('%4i ',iter);
      if rem(iter,20)==0
         fprintf('\n');
      end
ber(iter)=MLSE(snr(snr_index),C,N);
end;

BER(snr_index)=mean(ber);

save results_mlse_c2 BER C N block_num snr;

end;

set(0,'DefaultAxesFontSize',18);
set(0,'DefaultTextFontSize',18);
set(0,'DefaultTextFontName','times');
set(0,'DefaultAxesFontName','times');

figure
pl1=semilogy(snr,BER,'r-o','LineWidth',2);
xlabel('SNR  in  dB','FontSize',18);
ylabel('Symbol  Error  Rate','FontSize',18);
grid on;

toc





