mirror of https://github.com/pvnis/srsRAN_4G.git
Fixed SRS not working with some configurations
parent
121f363898
commit
ce5bece317
@ -1,44 +1,47 @@
|
||||
clear
|
||||
ueConfig=struct('NCellID',1,'NULRB',25,'DuplexMode','FDD','NSubframe',0,'NFrame',0,'CyclicPrefixUL','Normal','NTxAnts',1);
|
||||
srsConfig=struct('NTxAnts',1,'ConfigIdx',0,'SeqGroup',1,'SeqIdx',0,'TxComb',0);
|
||||
ueConfig=struct('NCellID',1,'NULRB',100,'DuplexMode','FDD','NSubframe',0,'CyclicPrefixUL','Normal','NTxAnts',1);
|
||||
srsConfig=struct('NTxAnts',1,'ConfigIdx',317,'SeqGroup',1,'SeqIdx',0,'TxComb',0);
|
||||
|
||||
addpath('../../build/srslte/lib/ch_estimation/test')
|
||||
|
||||
for csbw=2:7
|
||||
for uebw=0:3
|
||||
for hop=0:3
|
||||
for ncs=0:7
|
||||
for n_rrc=0:23
|
||||
srsConfig.BWConfig = csbw;
|
||||
srsConfig.BW = uebw;
|
||||
srsConfig.CyclicShift = ncs;
|
||||
srsConfig.HoppingBW = hop;
|
||||
srsConfig.FreqPosition = n_rrc;
|
||||
fprintf('Testing SRS: CSBW=%d, UEBW=%d, b_hop=%d n_rrc=%d, CyclicShift=%d\n',csbw, uebw, hop, n_rrc, ncs);
|
||||
for k=0:50
|
||||
for csbw=0:7
|
||||
for uebw=0:3
|
||||
for hop=0:3
|
||||
for ncs=0
|
||||
for n_rrc=1:5:20
|
||||
ueConfig.NFrame=mod(32*k,1024);
|
||||
srsConfig.BWConfig = csbw;
|
||||
srsConfig.BW = uebw;
|
||||
srsConfig.CyclicShift = ncs;
|
||||
srsConfig.HoppingBW = hop;
|
||||
srsConfig.FreqPosition = n_rrc;
|
||||
fprintf('Testing SRS: Nframe=%d, CSBW=%d, UEBW=%d, b_hop=%d n_rrc=%d\n',ueConfig.NFrame, csbw, uebw, hop, n_rrc);
|
||||
|
||||
[sym_mat, info]=lteSRS(ueConfig,srsConfig);
|
||||
[idx, info2]=lteSRSIndices(ueConfig,srsConfig);
|
||||
subframe_mat = lteULResourceGrid(ueConfig);
|
||||
subframe_mat(idx)=sym_mat;
|
||||
[sym_mat, info]=lteSRS(ueConfig,srsConfig);
|
||||
[idx, info2]=lteSRSIndices(ueConfig,srsConfig);
|
||||
subframe_mat = lteULResourceGrid(ueConfig);
|
||||
subframe_mat(idx)=sym_mat;
|
||||
|
||||
[sym, subframe]=srslte_refsignal_srs(ueConfig,srsConfig);
|
||||
[sym, subframe]=srslte_refsignal_srs(ueConfig,srsConfig);
|
||||
|
||||
error_sym=max(abs(sym-sym_mat));
|
||||
error_sf=max(abs(subframe_mat(:)-subframe));
|
||||
error_sym=max(abs(sym-sym_mat));
|
||||
error_sf=max(abs(subframe_mat(:)-subframe));
|
||||
|
||||
if (error_sym > 1e-3)
|
||||
disp(info)
|
||||
plot(1:length(sym),sym,1:length(sym_mat),sym_mat)
|
||||
legend('srsLTE','Matlab')
|
||||
error('Error in symbols');
|
||||
end
|
||||
if (error_sf > 1e-3)
|
||||
disp(info2)
|
||||
plot(abs(subframe-subframe_mat(:)))
|
||||
error('Error in subframe');
|
||||
if (error_sym > 3.5e-3)
|
||||
disp(info)
|
||||
plot(abs(sym-sym_mat))
|
||||
legend('srsLTE','Matlab')
|
||||
error('Error in symbols');
|
||||
end
|
||||
if (error_sf > 3.5e-3)
|
||||
disp(info2)
|
||||
plot(abs(subframe-subframe_mat(:)))
|
||||
error('Error in subframe');
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue