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

📄 mimonczf.m

📁 是一个四发四收的球型译码程序
💻 M
字号:
function [DetSignal]=MIMONCZF(InputMessage,ChM,M,Sigma,NFactor,OrdFlag)
% detect MIMO VBLAST Signals using Zero Forcing Algorithms
% CopyRight(C)    Jim, NCL, UESTC
% Date:           2005-11-17  
% ==========================================================================
% M:        modulation constalletion number
% ChM:      channel matrix
% NFactor:  the normalized factor
% ModFlag:  Flag for MPSK or MQAM
% OrdFlag:the flag of order. 0:SNR,1:LLR
% Sigma:    the variance of noise
% ==========================================================================


Factor=NFactor;
h=modem.qammod(M);
h2=modem.qamdemod(M);
for j=1:M
    s(j)=modulate(h,j-1)/sqrt(Factor);
end    

% L=length(InputMessage);
Rsg=InputMessage;
[Mrx,Mtx]=size(ChM);

DeSymb=zeros(Mtx,1);
ChanCoeff=zeros(Mtx,1);
% detecting order set
IndSet=1:Mtx;
ChMatrix=ChM;
for n=1:Mtx-1
    Chan=zeros(Mrx,Mtx-n+1);
    %     generate the channel matrix for current processing
    for i=1:Mtx-n+1
        Chan(:,i)=ChMatrix(:,IndSet(i));
    end
    %     ordering the row norm of Moore-Penrose Pseudoinverse of current channel matrix
    %     InvCh=pinv(Chan);
    InvCh=inv(Chan'*Chan)*Chan';
    MinNorm=1e6;
    ChanNorm=zeros(i,1);
    for m=1:i
        if OrdFlag==0
            ChanNorm(m)=norm(InvCh(m,:),'fro')^2;
        else
            y(m)=InvCh(m,:)*Rsg;
           
            TempDec=demodulate(h2,sqrt(Factor)*[y(m),0]);
            TempSignal(m)=sqrt(Factor)*modulate(h,TempDec(1))/Factor;
           
            for j=1:M
                Lambda(j)=(abs(y(m)-s(j))^2-abs(y(m)-TempSignal(m))^2)/(Sigma*Sigma*norm(InvCh(m,:),'fro')^2);
                ChanNorm(m)=ChanNorm(m)+exp(-Lambda(j));
            end
            %alpha(m)=abs(real(y(m)))/(Sigma*Sigma*norm(InvCh(m,:),'fro')^2);
        end
       
        if MinNorm>=ChanNorm(m)
            MinNorm=ChanNorm(m);
            ind=m;
        end
    end   

    ChanCoeff=Chan(:,ind);
    DeSymb(IndSet(ind))=InvCh(ind,:)*Rsg;
    
        OrigSymb=demodulate(h2,sqrt(Factor)*[DeSymb(IndSet(ind)),0]);
        DetSignal(IndSet(ind))=OrigSymb(1);
        OrgSymb=sqrt(Factor)*modulate(h,OrigSymb(1))/Factor;
   
    % cacellating the interference caused by current detected signal
    Rsg=Rsg-ChanCoeff.*OrgSymb;
    % rearrange the detection order set    
    temp=IndSet(ind);
    for k=ind:Mtx-1
        IndSet(k)=IndSet(k+1);
    end
    IndSet(Mtx)=temp;
end
DeSymb(IndSet(1))=ChMatrix(:,IndSet(1))'*Rsg/norm(ChMatrix(:,IndSet(1)),'fro')^2;

OrigSymb=demodulate(h2,sqrt(Factor)*[DeSymb(IndSet(1)),0]);

DetSignal(IndSet(1))=OrigSymb(1);
%output
DetSignal=DetSignal.';

⌨️ 快捷键说明

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