help in modified matlab function

hi, I want to modifie the methode of calcul
ll(mod_idx-idx+1,:) = log(sum(exp_mat((bitget(mapping,idx)==0),:),1)) ...
- log(sum(exp_mat((bitget(mapping,idx)==1),:),1));
in the following function matlab:
function ll = calc_ll(r,sigma_n2,constellation,mapping)
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);
ll = zeros(mod_idx,length(r));
for idx = 1:mod_idx
ll(mod_idx-idx+1,:) = log(sum(exp_mat((bitget(mapping,idx)==0),:),1)) ...
- log(sum(exp_mat((bitget(mapping,idx)==1),:),1));
end
ll=ll(:);
to this methode
kappa = H_cli/P_cli;
%
%cli_r = P_cli*r.*(abs(r)<kappa)+H_cli*sign(r).*(abs(r)>=kappa);
Thank's for any help

3 Kommentare

John D'Errico
John D'Errico am 25 Dez. 2016
1. Please learn to format your code so that it is readable. Select the code as pasted in. Then use the "{} Code" button.
2. Please ask a complete question. What do you need help with? How to delete the code from your computer? What modification are you looking to achieve? Otherwise, nobody can answer a non-question, that says nothing more than that you need help.
John BG
John BG am 25 Dez. 2016
what are H_cli and P_cli?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 25 Dez. 2016

Bearbeitet:

am 25 Dez. 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by