Guest User

Untitled

a guest
Apr 23rd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. function [y,index,ychoice] = MMSEreceiver(r,H,SNR,Es,sigma_h_sq,xchoice)
  2.  
  3. [N M] = size(H);
  4.  
  5. rho = (Es*M*2*sigma_h_sq)/(10^(SNR/10));
  6. G = inv(H'*H+rho/2*eye(M,M))*H';
  7.  
  8. for z=1:M;
  9. ng1(z) = (Es*(G(z,:)*H(:,z))^2) / (G(z,:)*(G(z,:))'*(rho/2) + sum(G(z,:)*H(:,z)*Es)); % jth SINR
  10. end
  11.  
  12. chk = 0;
  13.  
  14. while chk == 0
  15. [p index] = max(ng1);
  16. if xchoice(index) == 1
  17. xchoice(index) = 0;
  18. chk = 1;
  19. else
  20. ng1(index) = -inf;
  21. end
  22. end
  23.  
  24. ychoice = xchoice; % export modified input
  25.  
  26. % Get weighting vector
  27. w = G(index,:);
  28.  
  29. % Generate decision vector
  30. y = w*r;
Add Comment
Please, Sign In to add comment