mirror of https://github.com/pvnis/srsRAN_4G.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
2.9 KiB
Matlab
68 lines
2.9 KiB
Matlab
9 years ago
|
ueConfig=struct('NCellID',1,'NULRB',6,'CyclicPrefixUL','Normal','NTxAnts',1,'RNTI',64);
|
||
9 years ago
|
puschConfig=struct('NLayers',1,'OrthCover','Off','Shortened',0,'NBundled',0);
|
||
10 years ago
|
|
||
9 years ago
|
addpath('../../build//srslte/lib/phch/test')
|
||
10 years ago
|
|
||
9 years ago
|
cqilen=[0 4 20];
|
||
9 years ago
|
mods={'64QAM'};
|
||
10 years ago
|
rvs=0;
|
||
9 years ago
|
betas=[0 5.0, 20.0];
|
||
9 years ago
|
for p=1:ueConfig.NULRB
|
||
|
for i=0:26
|
||
|
for m=1:length(mods)
|
||
|
for r=1:length(rvs)
|
||
10 years ago
|
for bri=1:length(betas)
|
||
|
for back=1:length(betas)
|
||
|
for c=1:length(cqilen)
|
||
9 years ago
|
for s=0:9
|
||
9 years ago
|
ueConfig.NSubframe=s;
|
||
|
puschConfig.PRBSet=(0:p-1)';
|
||
|
|
||
|
TBs=lteTBS(length(puschConfig.PRBSet),i);
|
||
|
%TBs=256;
|
||
|
%trblkin=randi(2,TBs,1)-1;
|
||
|
trblkin=ones(1,TBs);
|
||
|
|
||
10 years ago
|
puschConfig.Modulation = mods{m};
|
||
|
puschConfig.RV = rvs(r);
|
||
9 years ago
|
puschConfig.BetaCQI = 5;
|
||
10 years ago
|
puschConfig.BetaRI = betas(bri);
|
||
|
puschConfig.BetaACK = betas(back);
|
||
10 years ago
|
|
||
9 years ago
|
if (betas(bri)>0)
|
||
9 years ago
|
ri_bit=randi(2,1,1)-1;
|
||
9 years ago
|
else
|
||
|
ri_bit=[];
|
||
|
end
|
||
|
if (betas(back)>0)
|
||
|
ack_bit=randi(2,1,1)-1;
|
||
|
else
|
||
|
ack_bit=[];
|
||
|
end
|
||
|
|
||
|
if (cqilen(c)>0 || TBs>0)
|
||
9 years ago
|
[enc, info]=lteULSCH(ueConfig,puschConfig,trblkin,ones(1,cqilen(c)),ri_bit,ack_bit);
|
||
|
cw_mat=ltePUSCH(ueConfig,puschConfig,enc);
|
||
|
%[drs, infodrs]=ltePUSCHDRS(ueConfig,puschConfig);
|
||
10 years ago
|
idx=ltePUSCHIndices(ueConfig,puschConfig);
|
||
9 years ago
|
%drs_idx=ltePUSCHDRSIndices(ueConfig,puschConfig);
|
||
10 years ago
|
subframe_mat = lteULResourceGrid(ueConfig);
|
||
|
subframe_mat(idx)=cw_mat;
|
||
9 years ago
|
|
||
9 years ago
|
[~, subframe_lib, cwlib, bits]=srslte_pusch_encode(ueConfig,puschConfig,trblkin,ones(1,cqilen(c)),ri_bit,ack_bit);
|
||
|
err=max(abs(subframe_mat(:)-subframe_lib));
|
||
10 years ago
|
if (err > 10^-5)
|
||
9 years ago
|
plot(abs(subframe_mat(:)-subframe_lib))
|
||
10 years ago
|
error('Error!');
|
||
|
end
|
||
10 years ago
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|