# Appro_MLD_detection.zip

• chen_guang
了解作者
• matlab
开发工具
• 1KB
文件大小
• zip
文件格式
• 0
收藏次数
• 1 积分
下载积分
• 5
下载次数
• 2013-04-01 14:31
上传日期
MIMO无线通信系统容量的研究与仿真，里面含有相应的MATLAB程序代码。
Appro_MLD_detection.zip
• Appro_MLD_detection.m
3KB

function [MLD_det_bit]=Appro_MLD_detection(y,H_ori,Tx,Modu_bit,SNR) %considering Tx=4, and 64QAM SNR=10^(SNR/10); Noise_power=1/SNR;%根据SNR=10log10(S/N) OneBySqrt42=0.1543033499; if Tx==4 & Modu_bit==6 %constitute all candidates for each antenna tmp=[-7,-5,-3,-1,1,3,5,7]; cand=zeros(64,1); for a=1:8 for b=1:8 index=b+(a-1)*8; cand(index)=tmp(a)+j*tmp(b); cand(index)=cand(index)*OneBySqrt42; end end %initial s1_index_optimal=0;s2_index_optimal=0;s3_index_optimal=0;s4_index_optimal=0; min_err=9999999; %sort P=inv(H_ori'*H_ori+Noise_power*eye(4)); SINR=1./real(diag(P)); sort_SINR=sort(SINR);%sort_SINR(Tx) is the largest, sort_SINR(Tx-1) is the second largest %find the original position in the SINR position=zeros(Tx,1); for tx=1:Tx position(tx)=findPosition(SINR,sort_SINR(tx),Tx); end bak_position=zeros(Tx,1); %position(Tx)<-> 3, position(Tx-1)<->4,position(Tx-2)<->1,position(Tx-3)<->2 H_bak=H_ori; bak_position=zeros(Tx,1); H(:,3)=H_bak(:,position(Tx)); bak_position(3)=position(Tx);%bak_position(3)=position(Tx) the largest one , original index is position(Tx) H(:,4)=H_bak(:,position(Tx-1));bak_position(4)=position(Tx-1); % bak_position(4)=position(Tx-1) original index is position(Tx-1) H(:,2)=H_bak(:,position(Tx-2));bak_position(2)=position(Tx-2); %bak_position(2)=position(Tx-2) H(:,1)=H_bak(:,position(Tx-3));bak_position(1)=position(Tx-3); %bak_position(1)=position(Tx-3) H_sub=[H(:,3),H(:,4)]; Filter_matrix1=inv(H_sub'*H_sub+Noise_power*eye(2))*H_sub';%2*4 H_sub=[H(:,4)]; Filter_matrix2=inv(H_sub'*H_sub+Noise_power*eye(1))*H_sub';%1*4 for s1_index=1:64 %s1_index z1=y-H(:,1)*cand(s1_index); for s2_index=1:64 z2=z1-H(:,2)*cand(s2_index); s3_estimated=Filter_matrix1(1,:)*z2; s3_index_optimal_test=sort_optimal_index(s3_estimated,cand,64); z3=z2-H(:,3)*cand(s3_index_optimal_test); s4_estimated=Filter_matrix2(1,:)*z3; s4_index_optimal_test=sort_optimal_index(s4_estimated,cand,64); z4=z3-H(:,4)*cand(s4_index_optimal_test); err=z4'*z4; if err<min_err min_err=err; s1_index_optimal=s1_index;s2_index_optimal=s2_index; s3_index_optimal=s3_index_optimal_test;s4_index_optimal=s4_index_optimal_test; end end end min_err; MLD_det_bit(bak_position(1),:)=component_wise(cand(s1_index_optimal),Modu_bit); MLD_det_bit(bak_position(2),:)=component_wise(cand(s2_index_optimal),Modu_bit); MLD_det_bit(bak_position(3),:)=component_wise(cand(s3_index_optimal),Modu_bit); MLD_det_bit(bak_position(4),:)=component_wise(cand(s4_index_optimal),Modu_bit); end %if Tx==4 return;

相关推荐