mirror of https://github.com/PentHertz/srsLTE.git
Merge branch 'dft' into tdec
This commit is contained in:
commit
e9387b05f2
|
@ -109,6 +109,10 @@ SRSLTE_API void srslte_dft_run(srslte_dft_plan_t *plan,
|
|||
void *in,
|
||||
void *out);
|
||||
|
||||
SRSLTE_API void srslte_dft_run_c_zerocopy(srslte_dft_plan_t *plan,
|
||||
cf_t *in,
|
||||
cf_t *out);
|
||||
|
||||
SRSLTE_API void srslte_dft_run_c(srslte_dft_plan_t *plan,
|
||||
cf_t *in,
|
||||
cf_t *out);
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
#include "srslte/common/sequence.h"
|
||||
|
||||
|
||||
#define USE_REDUCED_SAMPLING_RATES
|
||||
//#define USE_REDUCED_SAMPLING_RATES
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <complex.h>
|
||||
#include <fftw3.h>
|
||||
#include <string.h>
|
||||
#include <volk/volk.h>
|
||||
|
||||
#include "srslte/dft/dft.h"
|
||||
#include "srslte/utils/vector.h"
|
||||
|
@ -136,6 +137,10 @@ void srslte_dft_run(srslte_dft_plan_t *plan, void *in, void *out) {
|
|||
}
|
||||
}
|
||||
|
||||
void srslte_dft_run_c_zerocopy(srslte_dft_plan_t *plan, cf_t *in, cf_t *out) {
|
||||
fftwf_execute_dft(plan->p, in, out);
|
||||
}
|
||||
|
||||
void srslte_dft_run_c(srslte_dft_plan_t *plan, cf_t *in, cf_t *out) {
|
||||
float norm;
|
||||
int i;
|
||||
|
|
|
@ -163,13 +163,25 @@ void srslte_ofdm_rx_slot(srslte_ofdm_t *q, cf_t *input, cf_t *output) {
|
|||
}
|
||||
}
|
||||
|
||||
void srslte_ofdm_rx_slot_zerocopy(srslte_ofdm_t *q, cf_t *input, cf_t *output) {
|
||||
uint32_t i;
|
||||
for (i=0;i<q->nof_symbols;i++) {
|
||||
input += SRSLTE_CP_ISNORM(q->cp)?SRSLTE_CP_LEN_NORM(i, q->symbol_sz):SRSLTE_CP_LEN_EXT(q->symbol_sz);
|
||||
srslte_dft_run_c_zerocopy(&q->fft_plan, input, q->tmp);
|
||||
memcpy(output, &q->tmp[q->symbol_sz/2+q->nof_guards], sizeof(cf_t)*q->nof_re/2);
|
||||
memcpy(&output[q->nof_re/2], &q->tmp[1], sizeof(cf_t)*q->nof_re/2);
|
||||
input += q->symbol_sz;
|
||||
output += q->nof_re;
|
||||
}
|
||||
}
|
||||
|
||||
void srslte_ofdm_rx_sf(srslte_ofdm_t *q, cf_t *input, cf_t *output) {
|
||||
uint32_t n;
|
||||
if (q->freq_shift) {
|
||||
srslte_vec_prod_ccc(input, q->shift_buffer, input, 2*q->slot_sz);
|
||||
}
|
||||
for (n=0;n<2;n++) {
|
||||
srslte_ofdm_rx_slot(q, &input[n*q->slot_sz], &output[n*q->nof_re*q->nof_symbols]);
|
||||
srslte_ofdm_rx_slot_zerocopy(q, &input[n*q->slot_sz], &output[n*q->nof_re*q->nof_symbols]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue