add helper to create cexp function for entire subframe

master
Andre Puschmann 6 years ago
parent 4f42c0796c
commit 4edcedd2b3

@ -53,4 +53,6 @@ SRSLTE_API void srslte_cexptab_gen_direct(cf_t *x,
float freq, float freq,
uint32_t len); uint32_t len);
SRSLTE_API void srslte_cexptab_gen_sf(cf_t* x, float freq, uint32_t fft_size);
#endif // SRSLTE_CEXPTAB_H #endif // SRSLTE_CEXPTAB_H

@ -25,6 +25,7 @@
#include <assert.h> #include <assert.h>
#include <complex.h> #include <complex.h>
#include "srslte/phy/common/phy_common.h"
#include "srslte/phy/utils/cexptab.h" #include "srslte/phy/utils/cexptab.h"
int srslte_cexptab_init(srslte_cexptab_t *h, uint32_t size) { int srslte_cexptab_init(srslte_cexptab_t *h, uint32_t size) {
@ -76,3 +77,16 @@ void srslte_cexptab_gen_direct(cf_t *x, float freq, uint32_t len) {
} }
} }
void srslte_cexptab_gen_sf(cf_t* x, float freq, uint32_t fft_size)
{
cf_t* ptr = x;
for (uint32_t n = 0; n < 2; n++) {
for (uint32_t i = 0; i < 7; i++) {
uint32_t cplen = SRSLTE_CP_LEN_NORM(i, fft_size);
for (uint32_t t = 0; t < fft_size + cplen; t++) {
ptr[t] = cexpf(I * 2 * M_PI * ((float)t - (float)cplen) * freq / fft_size);
}
ptr += fft_size + cplen;
}
}
}

Loading…
Cancel
Save