📄 c_lambda.m
字号:
% ======================================================================
% C_LAMBDA.m
% ==========
% Description: This m-file implements the Log-Likelihood Ratio Calculator
% (LLRC) to be used in the MAP-decoder.
%
% Usage: [Lambda] = c_lambda(Alpha0, Alpha1, Beta0, Beta1, Lc)
% Inputs:
% Alpha0: Forward State-Metrics (FSM) for input bit 0.
% Alpha1: Forward State-Metrics (FSM) for input bit 1.
% Beta0: Backward State-Metrics (BSM) for input bit 0.
% Beta1: Backward State-Metrics (BSM) for input bit 1.
% Lc: Channel Reliability Value.
% Outputs:
% Lambda: The Log-Likelihood Ratios (LLRs)
% Output data format: Lambda(Trellis Depth Indicator).
% ======================================================================
function [Lambda] = C_LAMBDA(Alpha0, Alpha1, Beta0, Beta1, Lc)
% --------------
% Initialisation
% --------------
[Number_Of_States, Trellis_Depth] = size(Alpha0);
Lambda = zeros(1,Trellis_Depth);
% ---------------------------------------------
% M A P: Log-Likelihood Ratio Calculator (LLRC)
% ---------------------------------------------
Scaling_Factor = 1/(2*Lc);
LLR_Limit = 100.0/sqrt(Lc);
for TD=1:Trellis_Depth
LLR_Input0 = sum(Alpha0(:,TD).*Beta0(:,TD));
LLR_Input1 = sum(Alpha1(:,TD).*Beta1(:,TD));
if LLR_Input0 == 0
Lambda(TD) = LLR_Limit;
elseif LLR_Input1 <= 1e-10;
Lambda(TD) = -LLR_Limit;
else
LLR_Ratio = LLR_Input1/LLR_Input0;
Lambda(TD) = Scaling_Factor * log(LLR_Ratio);
end
end
% ======================================================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -