Added zero-copy option to dft module

master
ismagom 9 years ago
parent bb56d4895d
commit 67884f3368

@ -511,9 +511,9 @@ int main(int argc, char **argv) {
sigaddset(&sigset, SIGINT);
sigprocmask(SIG_UNBLOCK, &sigset, NULL);
signal(SIGINT, sig_int_handler);
cuhd_set_master_clock_rate(uhd, 30.72e6);
if (!output_file_name) {
cuhd_set_master_clock_rate(uhd, 30.72e6);
printf("Set TX rate: %.2f MHz\n",
cuhd_set_tx_srate(uhd, srslte_sampling_freq_hz(cell.nof_prb)) / 1000000);
printf("Set TX gain: %.1f dB\n", cuhd_set_tx_gain(uhd, uhd_gain));

@ -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]);
}
}

@ -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 */
srslte_ofdm_rx_sf(&q->fft, input, q->sf_symbols);
/* Get channel estimates for each port */
srslte_chest_dl_estimate(&q->chest, q->sf_symbols, q->ce, sf_idx);

Loading…
Cancel
Save