changes to the conv fft for optimization

master
yagoda 8 years ago
parent d28532bbfa
commit a3551e2d0b

@ -58,11 +58,6 @@ SRSLTE_API int srslte_conv_fft_cc_init(srslte_conv_fft_cc_t *q,
uint32_t input_len,
uint32_t filter_len);
SRSLTE_API int srslte_conv_fft_cc_init_opt(srslte_conv_fft_cc_t *q,
uint32_t input_len,
uint32_t filter_len,
cf_t **filter_time,
cf_t **filter_freq);
SRSLTE_API void srslte_conv_fft_cc_free(srslte_conv_fft_cc_t *q);

@ -183,10 +183,15 @@ int srslte_pss_synch_init_fft_offset_decim(srslte_pss_synch_t *q, uint32_t frame
for(N_id_2 = 0; N_id_2<3; N_id_2++)
q->pss_signal_freq_full[N_id_2] = srslte_vec_malloc(buffer_size * sizeof(cf_t));
if (srslte_conv_fft_cc_init_opt(&q->conv_fft, frame_size, fft_size, q->pss_signal_time,q->pss_signal_freq_full)) {
if (srslte_conv_fft_cc_init(&q->conv_fft, frame_size, fft_size)) {
fprintf(stderr, "Error initiating convolution FFT\n");
goto clean_and_exit;
}
for(int i =0; i< 3; i++)
{
srslte_dft_run_c(&q->conv_fft.filter_plan, q->pss_signal_time[i], q->pss_signal_freq_full[i]);
}
#endif
srslte_pss_synch_reset(q);

@ -31,12 +31,9 @@
#include "srslte/dft/dft.h"
#include "srslte/utils/vector.h"
#include "srslte/utils/convolution.h"
int srslte_conv_fft_cc_init(srslte_conv_fft_cc_t *q, uint32_t input_len, uint32_t filter_len)
{
srslte_conv_fft_cc_init_opt(q, input_len, filter_len, NULL, NULL);
}
int srslte_conv_fft_cc_init_opt(srslte_conv_fft_cc_t *q, uint32_t input_len, uint32_t filter_len, cf_t **filter_time, cf_t **filter_freq) {
int srslte_conv_fft_cc_init(srslte_conv_fft_cc_t *q, uint32_t input_len, uint32_t filter_len) {
q->input_len = input_len;
q->filter_len = filter_len;
q->output_len = input_len+filter_len;
@ -64,14 +61,6 @@ int srslte_conv_fft_cc_init_opt(srslte_conv_fft_cc_t *q, uint32_t input_len, uin
srslte_dft_plan_set_norm(&q->filter_plan, true);
srslte_dft_plan_set_norm(&q->output_plan, false);
if(filter_time != NULL)
{
for(int i =0; i< 3; i++)
{
srslte_dft_run_c(&q->filter_plan, filter_time[i], filter_freq[i]);
}
printf("optimization being used\n");
}
return SRSLTE_SUCCESS;
}
@ -105,15 +94,10 @@ uint32_t srslte_conv_fft_cc_run_opt(srslte_conv_fft_cc_t *q, cf_t *input, cf_t *
}
uint32_t srslte_conv_fft_cc_run(srslte_conv_fft_cc_t *q, cf_t *input, cf_t *filter, cf_t *output) {
srslte_dft_run_c(&q->input_plan, input, q->input_fft);
srslte_dft_run_c(&q->filter_plan, filter, q->filter_fft);
srslte_vec_prod_ccc(q->input_fft,q->filter_fft,q->output_fft,q->output_len);
srslte_dft_run_c(&q->output_plan, q->output_fft, output);
return q->output_len-1;
return srslte_conv_fft_cc_run_opt(q, input, q->filter_fft, output);
}

Loading…
Cancel
Save