DL Channel estimation results accepts nof RE

This commit is contained in:
Xavier Arteaga 2020-11-11 18:49:00 +01:00 committed by Andre Puschmann
parent ce330a6dfb
commit 6b5c4148c8
2 changed files with 8 additions and 2 deletions

View File

@ -141,6 +141,7 @@ SRSLTE_API int srslte_chest_dl_init(srslte_chest_dl_t* q, uint32_t max_prb, uint
SRSLTE_API void srslte_chest_dl_free(srslte_chest_dl_t* q);
SRSLTE_API int srslte_chest_dl_res_init(srslte_chest_dl_res_t* q, uint32_t max_prb);
SRSLTE_API int srslte_chest_dl_res_init_re(srslte_chest_dl_res_t* q, uint32_t nof_re);
SRSLTE_API void srslte_chest_dl_res_set_identity(srslte_chest_dl_res_t* q);

View File

@ -207,9 +207,14 @@ void srslte_chest_dl_free(srslte_chest_dl_t* q)
}
int srslte_chest_dl_res_init(srslte_chest_dl_res_t* q, uint32_t max_prb)
{
return srslte_chest_dl_res_init_re(q, SRSLTE_SF_LEN_RE(max_prb, SRSLTE_CP_NORM));
}
int srslte_chest_dl_res_init_re(srslte_chest_dl_res_t* q, uint32_t nof_re)
{
bzero(q, sizeof(srslte_chest_dl_res_t));
q->nof_re = SRSLTE_SF_LEN_RE(max_prb, SRSLTE_CP_NORM);
q->nof_re = nof_re;
for (uint32_t i = 0; i < SRSLTE_MAX_PORTS; i++) {
for (uint32_t j = 0; j < SRSLTE_MAX_PORTS; j++) {
q->ce[i][j] = srslte_vec_cf_malloc(q->nof_re);
@ -217,7 +222,7 @@ int srslte_chest_dl_res_init(srslte_chest_dl_res_t* q, uint32_t max_prb)
perror("malloc");
return -1;
}
srslte_vec_cf_zero(q->ce[i][j], SRSLTE_SF_LEN_RE(max_prb, SRSLTE_CP_NORM));
srslte_vec_cf_zero(q->ce[i][j], nof_re);
}
}
return 0;