资源简介

Turbo码在AWGN信道下的仿真,可以运行,程序有完整的注释,而且有运行后的图,也有程序提醒。

资源截图

代码片段和文件信息

function [soft_outex_info]=algorithm_logmap(ingLcpri_infolstatenstatelparoutput)
%turbo decoder -logMAP algorithm
%Input:
% in           --2 by N matrix.
%              --row1 information bitsincluding terminating bits
%              --row2 parity bits
% g            --generator vectors
% Lc           --channel reliability factor 
% pri_info     --priori information. not including terminating bits
% lstate       --last state
% nstate       --next state
% lparoutput   --last parity output
%Output:
% soft_out     --soft outputnot including termianting bits
% ex_info      --external information not including terminating bits
%
% chenxiao 2010.7 SEU Email:chenxiao20072008@gmail.com

[~L_total]=size(in); % total number of bits
[~K]=size(g); 
m=K-1;
nstates=2^m; % number of states in the trellis
infinity=1000;

% alpha initialization
alpha(11)=0; 
alpha(12:nstates)=-infinity*ones(1nstates-1);

% beta initialization
% no terminate
beta(L_total+11:nstates)=log(1/nstates);

% compute gamma
gamma=zeros(L_totalnstates2); %preallocate for speed

for i=1:L_total
    for st=1:nstates
        gamma(ist1)=(-1)*pri_info(i)/2+Lc/2*([-1 lparoutput(1st)]*in(:i)); % a trasition by 0
        gamma(ist2)=pri_info(i)/2+Lc/2*([1 lparoutput(2st)]*in(:i)); % a trasition by 1
    end
end

% Trace forward compute alpha
for i=2:L_total
    for st=1:nstates
        alpha(ist)=max(gamma(i-1st1)+alpha(i-1lstate(1st))...
            gamma(i-1st2)+alpha(i-1lstate(2st)))+...
            log(1+exp(-abs(gamma(i-1st1)+alpha(i-1lstate(1st))-...
            gamma(i-1st2)-alpha(i-1lstate(2st))))); % look up table is better
    end
end

% Trace backward compute beta
for i=L_total:-1:2
    for st=1:nstates
        beta(ist)=max(gamma(instate(1st)1)+beta(i+1nstate(1st))...
            gamma(instate(2st)2)+beta(i+1nstate(2st)))+...
            log(1+exp(-abs(gamma(instate(1st)1)+beta(i+1nstate(1st))-...
            gamma(instate(2st)2)-beta(i+1nstate(2st))))); % look up table is better
    end
end

% Compute the soft output log-likelihood ratio of symbols in the frame
temp0=zeros(1nstates); %preallocate for speed
temp1=zeros(1nstates); %preallocate for speed
soft_out=zeros(1L_total); %preallocate for speed
for i=1:L_total
    for st=1:nstates
        temp0(st)=gamma(ist1)+alpha(ilstate(1st))+beta(i+1st);
        temp1(st)=gamma(ist2)+alpha(ilstate(2st))+beta(i+1st);
    end
    soft1=max(temp1(2)temp1(1))+log(1+exp(-abs(temp1(2)-temp1(1))));
    soft0=max(temp0(2)temp0(1))+log(1+exp(-abs(temp0(2)-temp0(1))));
    for j=3:nstates
        soft1=max(temp1(j)soft1)+log(1+exp(-abs(temp1(j)-soft1)));
        soft0=max(temp0(j)soft0)+log(1+exp(-abs(temp0(j)-soft0)));
    end
    soft_out(i)=soft1-soft0;
end
ex_info=soft_out-pri_info-Lc*in(1:);

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      10651  2013-10-29 11:45  Turbo码在AWGN信道下仿真\log1000-AWGN\1000_1.fig

     文件      13180  2013-10-28 14:35  Turbo码在AWGN信道下仿真\log1000-AWGN\1000_2.fig

     文件       6799  2013-10-28 15:12  Turbo码在AWGN信道下仿真\log1000-AWGN\1000_eg.fig

     文件       2830  2010-07-17 19:32  Turbo码在AWGN信道下仿真\log1000-AWGN\algorithm_logmap.m

     文件       2216  2010-07-17 19:32  Turbo码在AWGN信道下仿真\log1000-AWGN\algorithm_maxlogmap.m

     文件       6738  2014-03-12 16:26  Turbo码在AWGN信道下仿真\log1000-AWGN\AWGN.fig

     文件       2232  2010-07-17 19:32  Turbo码在AWGN信道下仿真\log1000-AWGN\decoder.m

     文件       2121  2010-07-17 19:32  Turbo码在AWGN信道下仿真\log1000-AWGN\encoder.m

     文件       1518  2013-10-25 11:10  Turbo码在AWGN信道下仿真\log1000-AWGN\gen_trellis.m

     文件       2379  2014-03-12 16:02  Turbo码在AWGN信道下仿真\log1000-AWGN\method_Log1000.m

     文件        591  2014-03-12 16:25  Turbo码在AWGN信道下仿真\log1000-AWGN\method_Log_eg1000.mat

     文件         72  2014-03-12 16:55  Turbo码在AWGN信道下仿真\log1000-AWGN\新建 文本文档.txt

     文件       2830  2010-07-17 19:32  Turbo码在AWGN信道下仿真\log1024_31\algorithm_logmap.m

     文件       2216  2010-07-17 19:32  Turbo码在AWGN信道下仿真\log1024_31\algorithm_maxlogmap.m

     文件       2232  2010-07-17 19:32  Turbo码在AWGN信道下仿真\log1024_31\decoder.m

     文件       2121  2010-07-17 19:32  Turbo码在AWGN信道下仿真\log1024_31\encoder.m

     文件       1518  2013-10-25 11:10  Turbo码在AWGN信道下仿真\log1024_31\gen_trellis.m

     文件       2343  2013-11-01 10:51  Turbo码在AWGN信道下仿真\log1024_31\method_Log1024_31.m

     文件       8772  2013-10-30 11:10  Turbo码在AWGN信道下仿真\test\1.fig

     文件      15676  2013-10-29 13:23  Turbo码在AWGN信道下仿真\test\75_1315_3721.fig

     文件      13492  2013-10-29 13:30  Turbo码在AWGN信道下仿真\test\campare.fig

     文件        595  2013-10-30 11:04  Turbo码在AWGN信道下仿真\test\method_Log_eg.mat

     文件        593  2013-10-28 15:11  Turbo码在AWGN信道下仿真\test\method_Log_eg1000.mat

     文件        560  2013-10-25 21:35  Turbo码在AWGN信道下仿真\test\method_Log_eg3721.mat

     文件        603  2013-10-25 20:47  Turbo码在AWGN信道下仿真\test\method_Log_eg75.mat

     文件        701  2013-10-30 11:10  Turbo码在AWGN信道下仿真\test\test3_1.m

     目录          0  2014-03-12 16:53  Turbo码在AWGN信道下仿真\log1000-AWGN

     目录          0  2014-03-12 16:52  Turbo码在AWGN信道下仿真\log1024_31

     目录          0  2014-03-12 16:52  Turbo码在AWGN信道下仿真\test

     目录          0  2014-03-12 16:52  Turbo码在AWGN信道下仿真

............此处省略3个文件信息

评论

共有 条评论