Code covered by the BSD License  

Highlights from
performance of a digital transmission in the presence of the error correction coding

image thumbnail

performance of a digital transmission in the presence of the error correction coding

by

 

This M-file gives you the importance of digital transmission with the presence of the correction

Simulation.m
%performance of a digital transmission in the presence of the error
%correction coding%
clc;close all;clear;
EBN0=0:9;
Nb=9999;%number of data
for k=1:10;
   rand('seed',8);randn('seed',8);
d=rand(1,Nb)>0.5;%generation of data
d_m=2*d-1;
%---error correction coding---%
       %Matrix control and generator matrix%
       H=gf([1 0 1 1 0 0;1 1 0 0 1 0;0 1 1 0 0 1],1);
       G=gf([1 0 0 1 1 0;0 1 0 0 1 1;0 0 1 1 0 1],1);
       n=size(G,2);y=size(G,1);
       c_coded=coded(d,G,n,y);
       %---Mapping---%
c_coded_mapping=2*c_coded-1;
%---Canal AWGN---%
c_awgn=awgn(c_coded_mapping,EBN0(k),'measured');
d_m_awgn=awgn(d_m,EBN0(k),'measured');
%---Decision---%
d_m_decision=d_m_awgn>mean(d_m_awgn);
c_decision=c_awgn>mean(c_awgn);
%---Error correcting decoding---%
c_decoded=DecodeSyndromique(c_decision,H);
%---Remove bits controls---%
c_dec_par=reshape(c_decoded,n,[])';
for i=1:length(c_decoded)/n;
    for j=1:y;
   d_par(i,j)= c_dec_par(i,j);
    end
end
        %conversion P/S%
d_recu=reshape(d_par',1,[]);
    %---Comparison of data transmitted with the data Received--%
verr=xor(d,d_recu);%with CCE
verr1=xor(d,d_m_decision);%without CCE
Nerr=sum(verr);%with CCE
Nerr1=sum(verr1);%without CCE
BER(k)=Nerr/Nb;%BER with CCE
BER1(k)=Nerr1/Nb;%BER without CCE    
end
semilogy(EBN0,BER1,'r','linewidth',2);grid on;hold on;
semilogy(EBN0,BER,'linewidth',2);grid on;hold on;
xlabel('Eb/N0 en dB','fontsize',15);
ylabel('TEB','fontsize',15);
legend('Without CCE','With CCE');

Contact us