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 *in,
|
||||||
void *out);
|
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,
|
SRSLTE_API void srslte_dft_run_c(srslte_dft_plan_t *plan,
|
||||||
cf_t *in,
|
cf_t *in,
|
||||||
cf_t *out);
|
cf_t *out);
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#include "srslte/common/sequence.h"
|
#include "srslte/common/sequence.h"
|
||||||
|
|
||||||
|
|
||||||
#define USE_REDUCED_SAMPLING_RATES
|
//#define USE_REDUCED_SAMPLING_RATES
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include <complex.h>
|
#include <complex.h>
|
||||||
#include <fftw3.h>
|
#include <fftw3.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <volk/volk.h>
|
||||||
|
|
||||||
#include "srslte/dft/dft.h"
|
#include "srslte/dft/dft.h"
|
||||||
#include "srslte/utils/vector.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) {
|
void srslte_dft_run_c(srslte_dft_plan_t *plan, cf_t *in, cf_t *out) {
|
||||||
float norm;
|
float norm;
|
||||||
int i;
|
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) {
|
void srslte_ofdm_rx_sf(srslte_ofdm_t *q, cf_t *input, cf_t *output) {
|
||||||
uint32_t n;
|
uint32_t n;
|
||||||
if (q->freq_shift) {
|
if (q->freq_shift) {
|
||||||
srslte_vec_prod_ccc(input, q->shift_buffer, input, 2*q->slot_sz);
|
srslte_vec_prod_ccc(input, q->shift_buffer, input, 2*q->slot_sz);
|
||||||
}
|
}
|
||||||
for (n=0;n<2;n++) {
|
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]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,7 @@ int srslte_ue_dl_decode_fft_estimate(srslte_ue_dl_t *q, cf_t *input, uint32_t sf
|
||||||
|
|
||||||
/* Run FFT for all subframe data */
|
/* Run FFT for all subframe data */
|
||||||
srslte_ofdm_rx_sf(&q->fft, input, q->sf_symbols);
|
srslte_ofdm_rx_sf(&q->fft, input, q->sf_symbols);
|
||||||
|
|
||||||
/* Get channel estimates for each port */
|
/* Get channel estimates for each port */
|
||||||
srslte_chest_dl_estimate(&q->chest, q->sf_symbols, q->ce, sf_idx);
|
srslte_chest_dl_estimate(&q->chest, q->sf_symbols, q->ce, sf_idx);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue