📄 chase_docoder.m
字号:
function [Output] = Chase_docoder(Input)
DeSymb=Input(1:4).';
BLR=Input(5:8);
IX=Input(9:12);
chan_Hv=Input(13:28);
Ch_Total=reshape(chan_Hv,4,4);
RxSig_MF=Input(29:32).';
Factor=10;
Tx=4;
Rx=4;
M=16;
h=modem.qammod(M);
h2 = modem.qamdemod(M);
Num_order=M;
Table_bit=zeros(Num_order,log2(M));
for i=2:Num_order
Table_bit(i,:)=de2bi(i-1,log2(M));
end
Ch_Q=5 ;
SNRdB=60;
SNR=10^((SNRdB)/10);
sigma_n2=sqrt(Tx)/sqrt(SNR);
ind=IX(1);
ChanCoeff=Ch_Total(:,ind);
Chan=horzcat(Ch_Total(:,1:ind-1),Ch_Total(:,ind+1:Tx));
DetSignal=demodulate(h2,sqrt(Factor)*DeSymb(ind,1));
Det_bit=de2bi(DetSignal,log2(M),2);
Bit_Vec=reshape(Det_bit,log2(M),1);
Table_pertur=zeros(Num_order,log2(M));
Phi=zeros(Num_order,1);
Temp_Ind=0;
for i=1:Num_order
Table_pertur(i,:)=xor(Table_bit(i,:),Bit_Vec.');
Phi(i)=Phi(i)+Table_pertur(i,1:log2(M))*abs(BLR(1,1:log2(M)).');
if Phi(i)<=Ch_Q
Temp_Ind=Temp_Ind+1;
IndSet(Temp_Ind)=i;
end
end
IndSet=IndSet(:,1:Temp_Ind);
ML_Matrix=zeros(Temp_Ind,1);
MLValue0=zeros(Tx*log2(M),1);
MLValue1=zeros(Tx*log2(M),1);
for i=1:Temp_Ind
Search_bit=Table_bit(IndSet(i),:);
DetBitMap=reshape(Search_bit,1,log2(M));
OrgSymb=bi2de(DetBitMap);
Sym1=sqrt(Factor)*modulate(h,OrgSymb)/Factor;
% cacellating the interference caused by current detected signal
ReSig=RxSig_MF-ChanCoeff.*Sym1;
Det_sig_temp=MIMONCZF(ReSig,Chan,M,sigma_n2,Factor,1);
DetTemp(:,i)=vertcat(Det_sig_temp(1:ind-1,1),OrgSymb(1,1),Det_sig_temp(ind:Tx-1,1));
Tx_sym=modulate(h,DetTemp(:,i))/sqrt(Factor);
ML_Matrix(i)=norm(RxSig_MF-Ch_Total*Tx_sym,'fro')^2;
end
[MinValue,Index]=min(ML_Matrix);
Det_sym_temp=DetTemp(:,Index);
Det_bit=de2bi(Det_sym_temp,log2(M),2);
dd_bit=reshape(Det_bit,Tx*log2(M),1);
Output=dd_bit;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -