您现在的位置:首页 >> ★免费资源 >> 源码下载 >> 内容

MATLAB代做-python代做-ML接收器

时间:2019-4-22 16:30:26 点击:

  核心提示:MATLAB代做-python代做-ML接收器...


function [bhat] = ML_detector(r_SD,r_RD,ahat_SD,ahat_RD,noise_var,eps)

%ML detector
j =sqrt(-1);

    s1 = 1/sqrt(2)*(1+j);
    s2 = 1/sqrt(2)*(1-j);
    s3 = 1/sqrt(2)*(-1-j);
    s4 = 1/sqrt(2)*(-1+j);
    s = [s1 s2 s3 s4];
    b = [0 0 0 1 1 1 1 0];
    bhat = zeros(1,2*length(r_SD));
    %N0 = 1;
    
    
    b_tr = RALEY_SETTINGS.b_tr_I;
    cc1 = ahat_SD* qpsk(b_tr);
    cc2 = ahat_RD* qpsk(b_tr);
    N0_SD = norm( r_SD(1:length(qpsk(b_tr)))-cc1 )^2/length(cc1);
    N0_RD = norm( r_RD(1:length(qpsk(b_tr)))-cc2 )^2/length(cc2);
%     N0_SD = 0.5;
%     N0_RD = 0.5;
    for i =1:length(r_SD)
                d1 = (1/(pi*N0_SD))*exp(-norm(r_SD(i)-ahat_SD*s(1))^2/ N0_SD)*...
                    ( (1-eps)^2*(1/(pi*N0_RD))*exp(-norm(r_RD(i)-ahat_RD*s(1))^2/N0_RD) +...
                    eps*(1-eps)*(1/(pi*N0_RD))*exp(-norm(r_RD(i)-ahat_RD*s(2))^2/N0_RD) +...
                    eps*(1-eps)*(1/(pi*N0_RD))*exp(-norm(r_RD(i)-ahat_RD*s(4))^2/N0_RD) +...
                    eps^2*(1/(pi*N0_RD))*exp(-norm(r_RD(i)-ahat_RD*s(3))^2/N0_RD) );
        
                d2 = (1/(pi*N0_SD))*exp(-norm(r_SD(i)-ahat_SD*s(2))^2/ N0_SD)*...
                    ( (1-eps)^2*(1/(pi*N0_RD))*exp(-norm(r_RD(i)-ahat_RD*s(2))^2/N0_RD) +...
                    eps*(1-eps)*(1/(pi*N0_RD))*exp(-norm(r_RD(i)-ahat_RD*s(1))^2/N0_RD) +...
                    eps*(1-eps)*(1/(pi*N0_RD))*exp(-norm(r_RD(i)-ahat_RD*s(3))^2/N0_RD) +...
                    eps^2*(1/(pi*N0_RD))*exp(-norm(r_RD(i)-ahat_RD*s(4))^2/N0_RD) );
        
                d3 = (1/(pi*N0_SD))*exp(-norm(r_SD(i)-ahat_SD*s(3))^2/ N0_SD)*...
                    ( (1-eps)^2*(1/(pi*N0_RD))*exp(-norm(r_RD(i)-ahat_RD*s(3))^2/N0_RD) +...
                    eps*(1-eps)*(1/(pi*N0_RD))*exp(-norm(r_RD(i)-ahat_RD*s(2))^2/N0_RD) +...
                    eps*(1-eps)*(1/(pi*N0_RD))*exp(-norm(r_RD(i)-ahat_RD*s(4))^2/N0_RD) +...
                    eps^2*(1/(pi*N0_RD))*exp(-norm(r_RD(i)-ahat_RD*s(1))^2/N0_RD) );
        
                d4 = (1/(pi*N0_SD))*exp(-norm(r_SD(i)-ahat_SD*s(4))^2/ N0_SD)*...
                    ( (1-eps)^2*(1/(pi*N0_RD))*exp(-norm(r_RD(i)-ahat_RD*s(4))^2/N0_RD) +...
                    eps*(1-eps)*(1/(pi*N0_RD))*exp(-norm(r_RD(i)-ahat_RD*s(1))^2/N0_RD) +...
                    eps*(1-eps)*(1/(pi*N0_RD))*exp(-norm(r_RD(i)-ahat_RD*s(3))^2/N0_RD) +...
                    eps^2*(1/(pi*N0_RD))*exp(-norm(r_RD(i)-ahat_RD*s(2))^2/N0_RD) );
        
        d = [d1 d2 d3 d4];
        
        bhat(2*i-1) = b(1);
        bhat(2*i)   = b(2);
        d_max= d(1);
        for j =2:4
            if  (d_max <d(j))
                d_max = d(j);
                bhat(2*i-1) = b(2*j-1);
                bhat(2*i)   = b(2*j);
            end
        end
        
    end

联系:highspeedlogic

QQ :1224848052

微信:HuangL1121

邮箱:1224848052@qq.com

网站:http://www.mat7lab.com/

网站:http://www.hslogic.com/

微信扫一扫:

Tags:ML 
作者:ML 来源:ML
  • 您是如何找到本站的?
  • 百度搜索
  • Google搜索
  • 查阅资料过程中
  • 论坛发现
  • 百度贴吧发现
  • 朋友介绍
本站最新成功开发工程项目案例
相关评论
发表我的评论
  • 大名:
  • 内容:
  • matlab代做|matlab专业代做|python代做|matlab淘宝代做|matlab代写(www.hslogic.com) © 2019 版权所有 All Rights Reserved.
  • Email:highspeed_logic@163.com 站长QQ: 1224848052

    专业代做/代写/承接、MATLAB、SIMULINK、FPGA项目、博士/硕士/本科毕业设计、课题设计、论文,毕业论文,Coursework、Eassy、Assignment