⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 equil222.m

📁 MIMO多径瑞利信道下的迫零+串行干扰抵消+自适应功率分配预编码算法仿真链路(simulink+m files)
💻 M
字号:
function [output]=equil222(u)
[N,M]=size(u);
M=M-2;
H=u(:,1:M);
Rx=u(:,M+1);
LastP=u(:,M+2);
LastP_Matrix=[1/(sqrt(LastP(1))),0,0,0;0,1/(sqrt(LastP(2))),0,0;0,0,1/(sqrt(LastP(3))),0;0,0,0,1/(sqrt(LastP(4)))];
output=zeros(2,4);
Index=zeros(1,4);
P=[sqrt(LastP(1)),0,0,0;0,sqrt(LastP(2)),0,0;0,0,sqrt(LastP(3)),0;0,0,0,sqrt(LastP(4))];
for t=1:4
  G_temp=pinv(H);
  G=LastP_Matrix*G_temp;
  if t==2
    for k=1:N
      G_temp(Index(1),k)=10000;
    end  
    G_two=H*P;
    G_two(:,Index(1))=0;
    G=pinv(G_two);
  end
  if t==3
    for k=1:N
      G_temp(Index(1),k)=10000;
      G_temp(Index(2),k)=10000;
    end  
      G_three=H*P;
      G_three(:,Index(1))=0;
      G_three(:,Index(2))=0;
      G=pinv(G_three);
  end  
  if t==4
    for k=1:N
      G_temp(Index(1),k)=10000;
      G_temp(Index(2),k)=10000;
      G_temp(Index(3),k)=10000;
    end     
      G_four=H*P;
      G_four(:,Index(1))=0;
      G_four(:,Index(2))=0;
      G_four(:,Index(3))=0;
      G=pinv(G_four);
  end 
   [C,Index(t)]=min((sum((abs(G_temp')).*(abs(G_temp')))));
   %Index(t)
    w=G(Index(t),:);
    y=(w)*(Rx);
    z=QPSK(y);
    output(2,Index(t))=z;    
    Delta(Index(t))=(4/(10^(20/10)))*(sum((abs((G_temp(Index(t),:)).')).*(abs((G_temp(Index(t),:)).'))));
    if t~=4  
     Rx=Rx-z*(H(:,Index(t))*sqrt(LastP(Index(t))));
    end
end
Lambda=exp(-(4+2*(Delta(1)*log(16*Delta(1))+Delta(2)*log(16*Delta(2))+Delta(3)*log(16*Delta(3))+Delta(4)*log(16*Delta(4))))/(2*(Delta(1)+Delta(2)+Delta(3)+Delta(4))));
output(1,1)=(-2*Delta(1)*log(16*Lambda*Delta(1)));
output(1,2)=(-2*Delta(2)*log(16*Lambda*Delta(2)));
output(1,3)=(-2*Delta(3)*log(16*Lambda*Delta(3)));
output(1,4)=(-2*Delta(4)*log(16*Lambda*Delta(4)));
%output(1,1)
%output(1,2)
%output(1,3)
%output(1,4)

    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -