Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

16 or 32 APSK demodulator(log likelihood ratios) -DVB S2

121 views
Skip to first unread message

tahir

unread,
Jan 18, 2011, 2:43:05 AM1/18/11
to
Hi,
I am trying to simulate the DVB S2 with APSK 16 and APSK 32. but LDPC decoder in the receiver side needs log likelihood ratios rather than bits demodulated from APSK demodulator. I somehow have the hard decision APSK demodulator which returns the bits to LDPC decoder, but LDPC requires soft decision values from APSK demodulator. As the simulink or matlab does not have soft decision APSK demodulator . So could anybody share the code for soft decision APSK demodulator(returning approximate log likelihood ratios) or at least guide how i can calculate this.

waiting for reply.

regards,

Tahir

Bernhard

unread,
Jan 18, 2011, 12:32:05 PM1/18/11
to
"tahir " <mtahi...@hotmail.com> wrote in message <ih3ga9$oub$1...@fred.mathworks.com>...
Hi Tahir!
A few months ago I wrote a matlab function which calculates the llr values for an arbitrary constellation, not the approximation but the exact one. Actually it's just implementing the formula which is given in the matlab help.
Here is the function! It's rather slow but it's good to get the idea! To speed it up implement it as a mex file. Please test it before you use it in critical environment.
I will upload it on matlab central in a few weeks.

function llr = calc_llr(r,sigma_n2,constellation,mapping)
%CALC_LLR LLR-Value Computation
% LLR = CALC_LLR(R, NOISE_VAR, CONSTELLATION, MAPPING) calculates the
% LLR-values LLR based on the received signal R. The vectors CONSTELLATION
% and MAPPING are usually generated by using MATLAB Modem Modulation
% Modem.<Type> and contain the complex or real constellations points and
% the bit mapping. NOISE_VAR denotes the noise variance of the received
% signal which must be available or at least an estimate for it.
%
% Input: R [Nx1]
% NOISE_VAR [1x1]
% CONSTELLATION [1xM]
% MAPPING [1xM]
% Output: LLR [Nx1]
%
% Author: Bernhard Schmidt
%
% Copyright 2010 by Bernhard Schmidt
% Permission is granted to use this program/data
% for educational/research only

mod_idx = log2(length(constellation));
dist = zeros(2^mod_idx,length(r));

for idx = 1:(2^mod_idx)
dist(idx,:) = (real(r) - (real(constellation(idx)))).^2 + (imag(r) - (imag(constellation(idx)))).^2;
end
exp_mat = exp(-1./sigma_n2.*dist);
llr = zeros(mod_idx,length(r));
for idx = 1:mod_idx
llr(mod_idx-idx+1,:) = log(sum(exp_mat((bitget(mapping,idx)==0),:),1)) - log(sum(exp_mat((bitget(mapping,idx)==1),:),1));
end
llr=llr(:);

0 new messages