资源简介
BCJR的译码,软判决.卷积码的编码和译码.
代码片段和文件信息
% BCJR algorithm for a half-rate systematic recursive convolutional code
% having 1 memory element a generator polynomial of [10] and a feedback
% polynomial of [11]. For more information see Section 1.3.2.2 of Rob‘s
% thesis (http://eprints.ecs.soton.ac.uk/14980) or the BCJR paper
% (http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=1055186).
% Copyright (C) 2008 Robert G. Maunder
% This program is free software: you can redistribute it and/or modify it
% under the terms of the GNU General Public License as published by the
% Free Software Foundation either version 3 of the License or (at your
% option) any later version.
% This program is distributed in the hope that it will be useful but
% WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
% Public License for more details.
% The GNU General Public License can be seen at http://www.gnu.org/licenses/.
function [aposteriori_uncoded_llrs aposteriori_encoded1_llrs aposteriori_encoded2_llrs] = bcjr_decoder(apriori_uncoded_llrs apriori_encoded1_llrs apriori_encoded2_llrs)
if(length(apriori_uncoded_llrs) ~= length(apriori_encoded1_llrs) || length(apriori_encoded1_llrs) ~= length(apriori_encoded2_llrs))
error(‘LLR sequences must have the same length‘);
end
% All calculations are performed in the logarithmic domain in order to
% avoid numerical issues. These occur in the normal domain because some of
% the confidences can get smaller than the smallest number the computer can
% store. See Section 1.3.2.4 of Rob‘s thesis for more information on this.
%
% A multiplication of two confidences is achieved using the addition of the
% corresponding log-confidences. If A = log(a) and B = log(b) then
% log(a*b) = A+B (Equation 1.17 in Rob‘s thesis).
%
% An addition of two confidences is achieved using the Jacobian logarithm
% of the corresponding log-confidences. The Jacobian logarithm is defined
% in the jac.m file. If A = log(a) and B = log(b) then
% log(a+b) = max(AB) + log(1+exp(-abs(A-B))) (Equation 1.19 in Rob‘s
% thesis).
% Matrix to describe the trellis
% Each row describes one transition in the trellis
% Each state is allocated an index 123... Note that this list starts
% from 1 rather than 0.
% FromState ToState UncodedBit Encoded1Bit Encoded2Bit
transitions = [1 1 0 0 0;
1 2 1 1 1;
2 1 1 1 0;
2 2 0 0 1];
% Find the largest state index in the transitions matrix
% In this example we have two states since the code has one memory element
state_count = max(max(transitions(:1))max(transitions(:2)));
% Calc
评论
共有 条评论