Fixed bug in PUSCH channel estimation

master
Ismael Gomez 8 years ago
parent 4cd6944418
commit 2985a68e91

@ -51,8 +51,6 @@
#include "srslte/config.h" #include "srslte/config.h"
#define SRSLTE_UE_UL_NOF_HARQ_PROCESSES 8
/* UE UL power control */ /* UE UL power control */
typedef struct { typedef struct {
// Common configuration // Common configuration

@ -145,13 +145,13 @@ void srslte_chest_ul_set_cfg(srslte_chest_ul_t *q,
} }
/* Uses the difference between the averaged and non-averaged pilot estimates */ /* Uses the difference between the averaged and non-averaged pilot estimates */
static float estimate_noise_pilots(srslte_chest_ul_t *q, cf_t *ce, uint32_t nrefs) static float estimate_noise_pilots(srslte_chest_ul_t *q, cf_t *ce, uint32_t nrefs, uint32_t n_prb[2])
{ {
float power = 0; float power = 0;
for (int i=0;i<2;i++) { for (int i=0;i<2;i++) {
power += srslte_chest_estimate_noise_pilots(&q->pilot_estimates[i*nrefs], power += srslte_chest_estimate_noise_pilots(&q->pilot_estimates[i*nrefs],
&ce[SRSLTE_REFSIGNAL_UL_L(i, q->cell.cp)*q->cell.nof_prb*SRSLTE_NRE], &ce[SRSLTE_REFSIGNAL_UL_L(i, q->cell.cp)*q->cell.nof_prb*SRSLTE_NRE+n_prb[i]*SRSLTE_NRE],
q->tmp_noise, q->tmp_noise,
nrefs); nrefs);
} }
@ -168,9 +168,9 @@ static float estimate_noise_pilots(srslte_chest_ul_t *q, cf_t *ce, uint32_t nref
} }
} }
#define cesymb(i) ce[SRSLTE_RE_IDX(q->cell.nof_prb,i,0)] // The interpolator currently only supports same frequency allocation for each subframe
#define cesymb(i) ce[SRSLTE_RE_IDX(q->cell.nof_prb,i,n_prb[0]*SRSLTE_NRE)]
static void interpolate_pilots(srslte_chest_ul_t *q, cf_t *ce, uint32_t nrefs) static void interpolate_pilots(srslte_chest_ul_t *q, cf_t *ce, uint32_t nrefs, uint32_t n_prb[2])
{ {
uint32_t L1 = SRSLTE_REFSIGNAL_UL_L(0, q->cell.cp); uint32_t L1 = SRSLTE_REFSIGNAL_UL_L(0, q->cell.cp);
uint32_t L2 = SRSLTE_REFSIGNAL_UL_L(1, q->cell.cp); uint32_t L2 = SRSLTE_REFSIGNAL_UL_L(1, q->cell.cp);
@ -206,10 +206,10 @@ void srslte_chest_ul_set_smooth_filter3_coeff(srslte_chest_ul_t* q, float w)
q->smooth_filter_len = 3; q->smooth_filter_len = 3;
} }
static void average_pilots(srslte_chest_ul_t *q, cf_t *input, cf_t *ce, uint32_t nrefs) { static void average_pilots(srslte_chest_ul_t *q, cf_t *input, cf_t *ce, uint32_t nrefs, uint32_t n_prb[2]) {
for (int i=0;i<2;i++) { for (int i=0;i<2;i++) {
srslte_chest_average_pilots(&input[i*nrefs], srslte_chest_average_pilots(&input[i*nrefs],
&ce[SRSLTE_REFSIGNAL_UL_L(i, q->cell.cp)*q->cell.nof_prb*SRSLTE_NRE], &ce[SRSLTE_REFSIGNAL_UL_L(i, q->cell.cp)*q->cell.nof_prb*SRSLTE_NRE+n_prb[i]*SRSLTE_NRE],
q->smooth_filter, nrefs, 1, q->smooth_filter_len); q->smooth_filter, nrefs, 1, q->smooth_filter_len);
} }
} }
@ -237,21 +237,25 @@ int srslte_chest_ul_estimate(srslte_chest_ul_t *q, cf_t *input, cf_t *ce,
srslte_vec_prod_conj_ccc(q->pilot_recv_signal, q->dmrs_pregen.r[cyclic_shift_for_dmrs][sf_idx][nof_prb], srslte_vec_prod_conj_ccc(q->pilot_recv_signal, q->dmrs_pregen.r[cyclic_shift_for_dmrs][sf_idx][nof_prb],
q->pilot_estimates, nrefs_sf); q->pilot_estimates, nrefs_sf);
if (n_prb[0] != n_prb[1]) {
printf("ERROR: intra-subframe frequency hopping not supported in the estimator!!\n");
}
if (ce != NULL) { if (ce != NULL) {
if (q->smooth_filter_len > 0) { if (q->smooth_filter_len > 0) {
average_pilots(q, q->pilot_estimates, ce, nrefs_sym); average_pilots(q, q->pilot_estimates, ce, nrefs_sym, n_prb);
interpolate_pilots(q, ce, nrefs_sym); interpolate_pilots(q, ce, nrefs_sym, n_prb);
/* If averaging, compute noise from difference between received and averaged estimates */ /* If averaging, compute noise from difference between received and averaged estimates */
q->noise_estimate = estimate_noise_pilots(q, ce, nrefs_sym); q->noise_estimate = estimate_noise_pilots(q, ce, nrefs_sym, n_prb);
} else { } else {
// Copy estimates to CE vector without averaging // Copy estimates to CE vector without averaging
for (int i=0;i<2;i++) { for (int i=0;i<2;i++) {
memcpy(&ce[SRSLTE_REFSIGNAL_UL_L(i, q->cell.cp)*q->cell.nof_prb*SRSLTE_NRE], memcpy(&ce[SRSLTE_REFSIGNAL_UL_L(i, q->cell.cp)*q->cell.nof_prb*SRSLTE_NRE+n_prb[i]*SRSLTE_NRE],
&q->pilot_estimates[i*nrefs_sym], &q->pilot_estimates[i*nrefs_sym],
nrefs_sym*sizeof(cf_t)); nrefs_sym*sizeof(cf_t));
} }
interpolate_pilots(q, ce, nrefs_sym); interpolate_pilots(q, ce, nrefs_sym, n_prb);
q->noise_estimate = 0; q->noise_estimate = 0;
} }
} }

@ -533,7 +533,7 @@ int srslte_pusch_decode(srslte_pusch_t *q,
srslte_demod_soft_demodulate_s(cfg->grant.mcs.mod, q->d, q->q, cfg->nbits.nof_re); srslte_demod_soft_demodulate_s(cfg->grant.mcs.mod, q->d, q->q, cfg->nbits.nof_re);
srslte_sequence_t *seq = NULL; srslte_sequence_t *seq = NULL;
// Create sequence if does not exist // Create sequence if does not exist
if (!q->users[rnti]) { if (!q->users[rnti]) {
seq = &q->tmp_seq; seq = &q->tmp_seq;
@ -557,7 +557,7 @@ int srslte_pusch_decode(srslte_pusch_t *q,
srslte_scrambling_s_offset(seq, q->q, 0, cfg->nbits.nof_bits); srslte_scrambling_s_offset(seq, q->q, 0, cfg->nbits.nof_bits);
srslte_sequence_free(seq); srslte_sequence_free(seq);
} }
return srslte_ulsch_uci_decode(&q->ul_sch, cfg, softbuffer, q->q, q->g, data, uci_data); return srslte_ulsch_uci_decode(&q->ul_sch, cfg, softbuffer, q->q, q->g, data, uci_data);
} else { } else {
return SRSLTE_ERROR_INVALID_INPUTS; return SRSLTE_ERROR_INVALID_INPUTS;

@ -463,7 +463,7 @@ static int decode_tb(srslte_sch_t *q,
par_tx = ((uint32_t) parity[0])<<16 | ((uint32_t) parity[1])<<8 | ((uint32_t) parity[2]); par_tx = ((uint32_t) parity[0])<<16 | ((uint32_t) parity[1])<<8 | ((uint32_t) parity[2]);
if (!par_rx) { if (!par_rx) {
INFO("Warning: Received all-zero transport block\n\n", 0); INFO("Warning: Received all-zero transport block\n\n", 0);
} }
if (par_rx == par_tx) { if (par_rx == par_tx) {
@ -657,7 +657,7 @@ int srslte_ulsch_uci_decode(srslte_sch_t *q, srslte_pusch_cfg_t *cfg, srslte_sof
} }
e_offset += Q_prime_cqi*Qm; e_offset += Q_prime_cqi*Qm;
// Decode ULSCH // Decode ULSCH
if (cfg->cb_segm.tbs > 0) { if (cfg->cb_segm.tbs > 0) {
uint32_t G = nb_q/Qm - Q_prime_ri - Q_prime_cqi; uint32_t G = nb_q/Qm - Q_prime_ri - Q_prime_cqi;

Loading…
Cancel
Save