help in modified matlab function

18 次查看(过去 30 天)
kokomy
kokomy 2016-12-25
编辑: per isakson 2016-12-25
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 个评论

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by