dft_precoding: add helper to get largest valid PRB

This commit is contained in:
Andre Puschmann 2020-04-23 10:19:53 +02:00
parent 04051a5cd0
commit a82b2da2dd
2 changed files with 11 additions and 0 deletions

View File

@ -53,6 +53,8 @@ SRSLTE_API void srslte_dft_precoding_free(srslte_dft_precoding_t* q);
SRSLTE_API bool srslte_dft_precoding_valid_prb(uint32_t nof_prb);
SRSLTE_API uint32_t srslte_dft_precoding_get_valid_prb(uint32_t nof_prb);
SRSLTE_API int
srslte_dft_precoding(srslte_dft_precoding_t* q, cf_t* input, cf_t* output, uint32_t nof_prb, uint32_t nof_symbols);

View File

@ -102,6 +102,15 @@ bool srslte_dft_precoding_valid_prb(uint32_t nof_prb)
return false;
}
/* Return largest integer that fulfills the DFT precoding PRB criterion (TS 36.213 Section 14.1.1.4C) */
uint32_t srslte_dft_precoding_get_valid_prb(uint32_t nof_prb)
{
while (srslte_dft_precoding_valid_prb(nof_prb) == false) {
nof_prb--;
}
return nof_prb;
}
int srslte_dft_precoding(srslte_dft_precoding_t* q, cf_t* input, cf_t* output, uint32_t nof_prb, uint32_t nof_symbols)
{