Fixed PUSCH w/o UL-SCH and CQI length lower than 11

master
ismagom 10 years ago
parent e83165dc2c
commit 2c93d2a1c9

@ -514,6 +514,7 @@ int ulsch_encode(sch_t *q, uint8_t *data, uint8_t *q_bits,
return ulsch_uci_encode(q, data, uci_data, q_bits, NULL, NULL, harq_process, rv_idx);
}
int ulsch_uci_encode(sch_t *q, uint8_t *data, uci_data_t uci_data, uint8_t *q_bits,
uint8_t *q_bits_ack, uint8_t *q_bits_ri,
harq_t *harq_process, uint32_t rv_idx)

@ -122,12 +122,12 @@ int encode_cqi_short(uci_cqi_t *q, uint8_t *data, uint32_t nof_bits, uint8_t *q_
for (int i=0;i<32;i++) {
q->encoded_cqi[i] = 0;
for (int n=0;n<nof_bits;n++) {
q->encoded_cqi[i] += (data[n] * M_basis_seq[i][n]) % 2;
q->encoded_cqi[i] += (data[n] * M_basis_seq[i][n]);
}
}
for (int i=0;i<Q;i++) {
q_bits[i] = q->encoded_cqi[i%32];
q_bits[i] = q->encoded_cqi[i%32]%2;
}
return LIBLTE_SUCCESS;
} else {
@ -203,8 +203,12 @@ static uint32_t Q_prime_ri_ack(uint32_t O, uint32_t O_cqi, float beta, harq_t *h
// If not carrying UL-SCH, get Q_prime according to 5.2.4.1
if (K == 0) {
if (O_cqi <= 11) {
K = O_cqi;
} else {
K = O_cqi+8;
}
}
uint32_t M_sc_init = harq_process->nof_prb_pusch_init * RE_X_RB;

@ -199,9 +199,9 @@ int main(int argc, char **argv) {
uci_data.beta_ri = 2.0;
uci_data.beta_ack = 2.0;
uci_data.uci_cqi = tmp;
uci_data.uci_cqi_len = 20;
uci_data.uci_ri_len = 0;
uci_data.uci_ack_len = 1;
uci_data.uci_cqi_len = 10;
uci_data.uci_ri_len = 1;
uci_data.uci_ack_len = 0;
uint32_t nof_symbols = 12*harq_process.prb_alloc.slot[0].nof_prb*RE_X_RB;
uint32_t nof_bits_e = nof_symbols * lte_mod_bits_x_symbol(harq_process.mcs.mod);

@ -1,23 +1,23 @@
ueConfig=struct('NCellID',1,'CyclicPrefixUL','Normal','NTxAnts',1);
puschConfig=struct('NLayers',1,'OrthCover','Off','PRBSet',0,'Modulation','64QAM','RV',0,'Shortened',0);
puschConfig=struct('NLayers',1,'OrthCover','Off','PRBSet',0,'Modulation','QPSK','RV',0,'Shortened',0);
addpath('../../debug/lte/phy/lib/phch/test')
TBs=99;
error=zeros(size(TBs));
for i=1:length(error)
%trblkin=randi(2,TBs(i),1)-1;
trblkin=randi(2,TBs(i),1)-1;
%trblkin=ones(TBs(i),1);
trblkin=[];
%trblkin=[];
puschConfig.BetaCQI = 7.0;
puschConfig.BetaRI = 5.0;
puschConfig.BetaACK = 11.0;
puschConfig.BetaCQI = 2.0;
puschConfig.BetaRI = 2.0;
puschConfig.BetaACK = 2.0;
[mat, info]=lteULSCH(ueConfig,puschConfig,trblkin,[ones(1,25)],[1],[1],[]);
[mat, info]=lteULSCH(ueConfig,puschConfig,trblkin,[],[],[],[]);
mat(mat==-2)=2;
mat(mat==-1)=3;
[lib]=liblte_ulsch_encode(ueConfig,puschConfig,trblkin,[ones(1,25)],[1],[1]);
[lib]=liblte_ulsch_encode(ueConfig,puschConfig,trblkin,[],[],[]);
error(i)=sum(abs(double(mat)-double(lib)));
if (length(TBs) == 1)
disp(error(i))

Loading…
Cancel
Save