📄 mimoncmmse.m
字号:
function [DetSignal]=MIMONCMMSE(InputMessage,ChM,M,Sigma,NFactor,OrdFlag)
% detect MIMO VBLAST Signals using MMSE Algorithms
% CopyRight(C) Jim, NCL, UESTC
% Date: 2005-11-17
% ==========================================================================
% M: modulation constalletion number
% Fs: sampling rate per symbol
% ChM: channel matrix
% Sigma: the variance of noise
% NFactor: the normalized factor
% OrdFlag: the flag of order. 0:SNR,1:SINR,2:LLR
% ==========================================================================
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=inv(Chan'*Chan+Sigma*Sigma*eye(Mtx-n+1)/(Mtx-n+1))*Chan';
% MMSE based on the SINR
if OrdFlag==1
MaxNorm=1e-6;
TempInter=0;
for m=1:i
ChanNorm(m)=abs(InvCh(m,:)*Chan(:,m))^2/(norm(InvCh(m,:)*Chan,'fro')^2-abs(InvCh(m,:)*Chan(:,m))^2+Sigma*Sigma/(Mtx-n+1)*norm(InvCh(m,:),'fro')^2);
if MaxNorm<=ChanNorm(m)
MaxNorm=ChanNorm(m);
ind=m;
end
end
else
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;
VarInterference=(Mtx-n+1)*(norm(InvCh(m,:)*Chan,'fro')^2-abs(InvCh(m,:)*Chan(:,m))^2)+Sigma*Sigma*norm(InvCh(m,:),'fro')^2;
for j=1:M
Lambda(j)=(abs(y(m)-InvCh(m,:)*Chan(:,m)*s(j))^2-abs(y(m)-InvCh(m,:)*Chan(:,m)*TempSignal(m))^2)/VarInterference;
ChanNorm(m)=ChanNorm(m)+exp(-Lambda(j));
end
end
if MinNorm>ChanNorm(m)
MinNorm=ChanNorm(m);
ind=m;
end
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 + -