I am trying to implement the soft-output for my soft-decoder, however, the resulting log-likelihood ratios are not corresponding to the corrected hard bits. The soft-output regards the LLR-values for the bits in the codewords, so they are not related to the modulation symbols.
The paper I am using is: 'Low Complexity Soft-Input Soft-Output Hamming Decoder' LINK
First, I calculate the probabilities from the old LLR-values. Then I multiply the probabilities for the respected codeword with the error pattern for this code word. Followed by taking the products of each column, which results in the probabilties for each error pattern of correct decoding. Next step is to normalize these probabilities. For the actual calculation of the new probabilities, the columns of the error pattern matrix are compared to the distorted codeword, for the bits that are equal the respected probabilities are summed. Eventually these probabilities are the probability that a bit equals 0. These probabilities are converted to LLR-values again and this should be the result.
The text in code form:
% Column-wise multiplication
P = abs(E_pattern - repmat(probability(i,:), size(E_pattern,1), 1));
P_prod = prod(P, 2).';
% Normalize the probabilities row-wise
P_sum = sum(P_prod,2);
P_norm = P_prod ./ sum(P_sum,2);
P_norm(P_sum == 0) = 1e-6;
for k = 1:PPM
% Weight
Weight = mod(data_old(i,k) + E_pattern(:,k),2);
% New probabilities codeword bits
P_zero(k) = sum(P_norm(Weight(:) == 0));
end
% New LLR values codeword bits
LLR(i,:) = log(P_zero./(1-P_zero));
Somehow, this is going wrong and I don't know where. As a result my LLR-values are wrong, they don't equal at all to my corrected hard bits.
Could someone help me with this?