function recLayerSymb = de_precoding(recPrecodedSymb,HfreqCell,iUE,SNRdB)
% 功能:根据估计的信道矩阵和发端预编码向量,计算等效的信道,并是用MMSE、ZF算法估计发送信号
global LTE_par
nTx = LTE_par.BS_par.nAnt;
nRx = LTE_par.UE_par.nAnt;
CFI = LTE_par.CFI;
scPerRB = LTE_par.scPerRB;
nOfdmSymb = LTE_par.nOfdmSymb;
nRB = LTE_par.UE_par.nRB(iUE);
M_0_SYMB = LTE_par.UE_par.M_0_SYMB(iUE);
cellID = LTE_par.BS_par.cellID;
iSubFrame = LTE_par.iSubFrame;
ns = iSubFrame*2;
nLayer = LTE_par.UE_par.nLayer(iUE);
detecAlg = LTE_par.UE_par.detecAlg;
preProcess = LTE_par.UE_par.preProcess;
nSubCarr = nRB*scPerRB;
pilotLocation = find_pilot(cellID,nTx,scPerRB,nOfdmSymb,nRB,ns);
if strcmp(preProcess,'singleAnt')
recLayerSymb = zeros(nLayer,M_0_SYMB);
iSymb = 1;
for iOfdm = CFI+1:nOfdmSymb
for iCarr = 1:nSubCarr
if pilotLocation(iCarr,iOfdm) == 0
r = zeros(nRx,1);
H = HfreqCell{iCarr};
for iRx = 1:nRx
r(iRx) = recPrecodedSymb{iRx}(iCarr,iOfdm);
end
xEst = mmse_detect(r,H,SNRdB); % MMSE检测
recLayerSymb(:,iSymb) = xEst;
iSymb = iSymb+1;
end
end
end
elseif strcmp(preProcess,'spatialMultiplexing')
recLayerSymb = zeros(nLayer,M_0_SYMB);
load CodeBook
PMI = LTE_par.UE_par.PMI(iUE);
PMI = PMI+1+(nLayer-1)*2^nTx;
if nTx == 2
iSymb = 1;
for iOfdm = CFI+1:nOfdmSymb
for iCarr = 1:nSubCarr
if pilotLocation(iCarr,iOfdm) == 0
H = HfreqCell{iCarr};
W = W_SM_2Tx(:,1:nLayer,PMI);
Heq = H*W;
r = zeros(nRx,1);
for iRx = 1:nRx
r(iRx) = recPrecodedSymb{iRx}(iCarr,iOfdm);
end
xEst = mmse_detect(r,Heq,SNRdB); % MMSE检测
recLayerSymb(:,iSymb) = xEst;
iSymb = iSymb+1;
end
end
end
elseif nTx == 4
iSymb = 1;
for iOfdm = CFI+1:nOfdmSymb
for iCarr = 1:nSubCarr
if pilotLocation(iCarr,iOfdm) == 0
H = HfreqCell{iCarr};
W = W_SM_4Tx(:,1:nLayer,PMI);
Heq = H*W;
r = zeros(nRx,1);
for iRx = 1:nRx
r(iRx) = recPrecodedSymb{iRx}(iCarr,iOfdm);
end
xEst = mmse_detect(r,Heq,SNRdB)
recLayerSymb(:,iSymb) = xEst;
iSymb = iSymb+1;
end
end
end
end
elseif strcmp(preProcess,'tranmitDiversity')
if nTx == 2
iSymb = 1;
recLayerSymb = zeros(nLayer,M_0_SYMB/2);
for iOfdm = CFI+1:nOfdmSymb
availableDataCarr = find(pilotLocation(:,iOfdm)==0);
len = length(availableDataCarr);
groupSize = 2;
if nRx == 1
for iGroup = 1:2:len
r = zeros(groupSize,nRx);
for itd = 1:groupSize
for iRx = 1:nRx
r(itd,iRx) = recPrecodedSymb{iRx}(availableDataCarr(iGroup+itd-1),iOfdm);
end
end
rTrans = [r(1);r(2)'];
H = 1/2*(HfreqCell{availableDataCarr(iGroup)}+HfreqCell{availableDataCarr(iGroup+1)});
Heq = [H(1,1) -H(1,2);H(1,2)' H(1,1)'];
xEst = mmse_detect(rTrans,Heq,SNRdB);
xEst(2) = xEst(2)';
iLayerSymb = xEst*sqrt(nLayer);
recLayerSymb(:,iSymb) = iLayerSymb;
iSymb = iSymb+1;
end
elseif nRx == 2
for iGroup = 1:2:len
r = zeros(groupSize,nRx);
for itd = 1:groupSize
for iRx = 1:nRx
r(itd,iRx) = recPrecodedSymb{iRx}(availableDataCarr(iGroup+itd-1),iOfdm);
end
end
rTrans = [r(1);r(2)';r(3);r(4)'];
H = 1/2*(HfreqCell{availableDataCarr(iGroup)}+HfreqCell{availableDataCarr(iGroup+1)});
Heq = [H(1,1) -H(1,2);H(1,2)' H(1,1)';H(2,1) -H(2,2);H(2,2)' H(2,1)'];
xEst = mmse_detect(rTrans,Heq,SNRdB);
xEst(2) = xEst(2)';
iLayerSymb = xEst*sqrt(nLayer);
recLayerSymb(:,iSymb) = iLayerSymb;
iSymb = iSymb+1;
end
end
end
elseif nTx == 4
if mod(M_0_SYMB,4) ~= 0
recLayerSymb = zeros(nLayer,(M_0_SYMB+2)/4);
else
recLayerSymb = zeros(nLayer,M_0_SYMB/4);
end
iSymb = 1;
for iOfdm = CFI+1:nOfdmSymb
availableDataCarr = find(pilotLocation(:,iOfdm)==0);
len = length(availableDataCarr);
groupSize = 4;
if nRx == 1
for iGroup = 1:4:len
r = zeros(groupSize,nRx);
for itd = 1:groupSize
for iRx = 1:nRx
r(itd,iRx) = recPrecodedSymb{iRx}(availableDataCarr(iGroup+itd-1),iOfdm);
end
end
xEst = zeros(groupSize,1);
rTrans = [r(1);r(2)'];
H = 1/2*(HfreqCell{availableDataCarr(iGroup+0)}...
+ HfreqCell{availableDataCarr(iGroup+2)});
H1 = H(:,[1 3]);
Heq = [H1(1,1) -H1(1,2);H1(1,2)' H1(1,1)'];
xEst([1 2]) = mmse_detect(rTrans,Heq,SNRdB);
xEst(2) = xEst(2)';
rTrans = [r(3);r(4)'];
H = 1/2*(HfreqCell{availableDataCarr(iGroup+1)}...
+ HfreqCell{availableDataCarr(iGroup+3)});
H2 = H(:,[2 4]);
Heq = [H2(1,1) -H2(1,2);H2(1,2)' H2(1,1)'];
xEst([3 4]) = mmse_detect(rTrans,Heq,SNRdB);
xEst(4) = xEst(4)';
recLayerSymb(:,iSymb) = xEst*sqrt(2);
iSymb = iSymb+1;
end
elseif nRx == 2
for iGroup = 1:4:len
r = zeros(groupSize,nRx);
for itd = 1:groupSize
for iRx = 1:nRx
r(itd,iRx) = recPrecodedSymb{iRx}(availableDataCarr(iGroup+itd-1),iOfdm);
end
end
xEst = zeros(groupSize,1);
rTrans = [r(1,1);r(2,1)';r(1,2);r(2,2)'];
H = 1/2*(HfreqCell{availableDataCarr(iGroup+0)}...
+ HfreqCell{availableDataCarr(iGroup+2)});
H1 = H(:,[1 3]);
阿里matlab建模师
- 粉丝: 4262
- 资源: 2843
最新资源
- (2951806)学生成绩管理系统软件
- 在线远程考试-JAVA-基于Spring Boot在线远程考试系统的设计与实现(毕业论文+PPT+开题+任务书)
- (31743232)图书管理系统 毕业设计
- 考虑大规模电动汽车接入电网的双层优化调度策略 软件:Matlab;cplex 介绍:摘要:随着经济发展和化石燃料短缺、环境污染严重的矛盾日益尖锐,电动汽车( Electric Vehicle,EV)的
- 武器检测54-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
- (42757812)0.96寸OLED显示屏STC8A8K64S4A12-IIC-例程
- (5820406)学籍管理系统vb+sql
- (767402)学生管理系统(VB+SQL)+论文
- VBA视频教程 0002
- 0f7c779db05cdd16f029ff16c742568e.apk
- 电影院购票-JAVA-基于springBoot的电影院购票系统设计与实现(毕业论文)
- (173083656)河西学院网络工程javaweb期末大作业.zip
- (174380844)1950年至2020年间各省GDP
- 基于Java+Swing+Mysql的超市客户关系管理系统(高分课程作业)
- 家政服务平台-JAVA-基于springBoot的家政服务平台的设计与实现(毕业论文)
- (175700654)适合练手、课程设计、毕业设计的Java项目源码:图书馆书库管理系统设计(论文+源代码).rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
- 1
- 2
前往页