Fixed ULSCH CQI receiver

master
Ismael Gomez 8 years ago
parent a98f19a05e
commit bb5e511513

@ -95,6 +95,11 @@ SRSLTE_API int srslte_pdsch_set_rnti_multi(srslte_pdsch_t *q,
SRSLTE_API uint16_t srslte_pdsch_get_rnti_multi(srslte_pdsch_t *q,
uint32_t idx);
SRSLTE_API float srslte_pdsch_coderate(uint32_t tbs,
uint32_t nof_re);
SRSLTE_API void print_pdsch_coderate();
SRSLTE_API int srslte_pdsch_cfg(srslte_pdsch_cfg_t *cfg,
srslte_cell_t cell,
srslte_ra_dl_grant_t *grant,

@ -156,6 +156,7 @@ SRSLTE_API float srslte_vec_avg_power_cf(cf_t *x, uint32_t len);
SRSLTE_API uint32_t srslte_vec_max_fi(float *x, uint32_t len);
SRSLTE_API uint32_t srslte_vec_max_abs_ci(cf_t *x, uint32_t len);
SRSLTE_API int16_t srslte_vec_max_star_si(int16_t *x, uint32_t len);
SRSLTE_API int16_t srslte_vec_max_abs_star_si(int16_t *x, uint32_t len);
/* maximum between two vectors */
SRSLTE_API void srslte_vec_max_fff(float *x, float *y, float *z, uint32_t len);

@ -57,6 +57,10 @@ extern int indices[100000];
extern int indices_ptr;
#endif
float srslte_pdsch_coderate(uint32_t tbs, uint32_t nof_re)
{
return (float) (tbs + 24)/(nof_re);
}
int srslte_pdsch_cp(srslte_pdsch_t *q, cf_t *input, cf_t *output, srslte_ra_dl_grant_t *grant, uint32_t lstart_grant, uint32_t nsubframe, bool put)
{

@ -646,16 +646,10 @@ int srslte_ulsch_uci_decode(srslte_sch_t *q, srslte_pusch_cfg_t *cfg, srslte_sof
// Decode CQI (multiplexed at the front of ULSCH)
if (uci_data->uci_cqi_len > 0) {
struct timeval t[3];
gettimeofday(&t[1], NULL);
ret = srslte_uci_decode_cqi_pusch(&q->uci_cqi, cfg, g_bits,
beta_cqi_offset[cfg->uci_cfg.I_offset_cqi],
Q_prime_ri, uci_data->uci_cqi_len,
uci_data->uci_cqi, &uci_data->cqi_ack);
gettimeofday(&t[2], NULL);
get_time_interval(t);
printf("texec=%d us\n", t[0].tv_usec);
if (ret < 0) {
return ret;
}

@ -298,10 +298,10 @@ int decode_cqi_long(srslte_uci_cqi_pusch_t *q, int16_t *q_bits, uint32_t Q,
srslte_rm_conv_rx_s(q_bits, Q, q->encoded_cqi_s, 3 * (nof_bits + 8));
// Set viterbi normalization based on amplitude
int16_t max = srslte_vec_max_star_si(q->encoded_cqi_s, 3 * (nof_bits + 8));
srslte_viterbi_set_gain_quant_s(&q->viterbi, max/36);
int16_t max = srslte_vec_max_abs_star_si(q->encoded_cqi_s, 3 * (nof_bits + 8));
srslte_viterbi_set_gain_quant_s(&q->viterbi, (float) abs(max)/36);
DEBUG("cconv_rx=", 0);
DEBUG("cconv_rx=", 0);
if (SRSLTE_VERBOSE_ISDEBUG()) {
srslte_vec_fprint_s(stdout, q->encoded_cqi_s, 3 * (nof_bits + 8));
}

@ -729,6 +729,17 @@ int16_t srslte_vec_max_star_si(int16_t *x, uint32_t len) {
#endif
}
int16_t srslte_vec_max_abs_star_si(int16_t *x, uint32_t len) {
uint32_t i;
int16_t m=-INT16_MIN;
for (i=0;i<len;i++) {
if (abs(x[i])>m) {
m=abs(x[i]);
}
}
return m;
}
void srslte_vec_max_fff(float *x, float *y, float *z, uint32_t len) {
#ifdef HAVE_VOLK_MAX_VEC_FUNCTION
volk_32f_x2_max_32f(z,x,y,len);

Loading…
Cancel
Save