add CFO correction method with offset

- CFO correction which allows to specify the offset within
  the correction table to allow phase-continuity across
  multi-subframe transmissions (NB-IoT)
master
Andre Puschmann 6 years ago
parent 7138126896
commit 4f42c0796c

@ -62,4 +62,7 @@ SRSLTE_API void srslte_cfo_correct(srslte_cfo_t *h,
cf_t *output, cf_t *output,
float freq); float freq);
SRSLTE_API void
srslte_cfo_correct_offset(srslte_cfo_t* h, const cf_t* input, cf_t* output, float freq, int cexp_offset, int nsamples);
#endif // SRSLTE_CFO_H #endif // SRSLTE_CFO_H

@ -101,3 +101,19 @@ void srslte_cfo_correct(srslte_cfo_t *h, const cf_t *input, cf_t *output, float
srslte_vec_apply_cfo(input, freq, output, h->nsamples); srslte_vec_apply_cfo(input, freq, output, h->nsamples);
#endif /* SRSLTE_CFO_USE_EXP_TABLE */ #endif /* SRSLTE_CFO_USE_EXP_TABLE */
} }
/* CFO correction which allows to specify the offset within the correction
* table to allow phase-continuity across multi-subframe transmissions (NB-IoT)
* Note that when correction table needs to be regenerated, the regeneration
* takes place for the maximum number of samples
*/
void srslte_cfo_correct_offset(
srslte_cfo_t* h, const cf_t* input, cf_t* output, float freq, int cexp_offset, int nsamples)
{
if (fabs(h->last_freq - freq) > h->tol) {
h->last_freq = freq;
srslte_cexptab_gen(&h->tab, h->cur_cexp, h->last_freq, h->nsamples);
DEBUG("CFO generating new table for frequency %.4fe-6\n", freq * 1e6);
}
srslte_vec_prod_ccc(&h->cur_cexp[cexp_offset], input, output, nsamples);
}
Loading…
Cancel
Save