commiting convolutional optimzation fix

master
yagoda 8 years ago
parent 64f559d354
commit 033ef49a26

@ -82,9 +82,10 @@ typedef struct SRSLTE_API {
uint32_t frame_size;
uint32_t N_id_2;
uint32_t fft_size;
cf_t pss_signal_freq_full;
cf_t *pss_signal_freq_full[3];
cf_t *pss_signal_time[3];
cf_t pss_signal_freq[3][SRSLTE_PSS_LEN]; // One sequence for each N_id_2
cf_t *tmp_input;
cf_t *conv_output;

@ -49,7 +49,7 @@ typedef struct SRSLTE_API {
srslte_dft_plan_t input_plan;
srslte_dft_plan_t filter_plan;
srslte_dft_plan_t output_plan;
cf_t *pss_signal_time_fft[3]; // One sequence for each N_id_2
//cf_t *pss_signal_time_fft[3]; // One sequence for each N_id_2
//cf_t *pss_signal_time[3];
}srslte_conv_fft_cc_t;
@ -58,6 +58,12 @@ 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);
SRSLTE_API uint32_t srslte_conv_fft_cc_run(srslte_conv_fft_cc_t *q,
@ -67,7 +73,7 @@ SRSLTE_API uint32_t srslte_conv_fft_cc_run(srslte_conv_fft_cc_t *q,
SRSLTE_API uint32_t srslte_conv_fft_cc_run_opt(srslte_conv_fft_cc_t *q,
cf_t *input,
int N_id_2,
cf_t *filter_freq,
cf_t *output);
SRSLTE_API uint32_t srslte_conv_cc(cf_t *input,

@ -179,12 +179,11 @@ int srslte_pss_synch_init_fft_offset(srslte_pss_synch_t *q, uint32_t frame_size,
}
#ifdef CONVOLUTION_FFT
//for(N_id_2 = 0; N_id_2<3; N_id_2++)
// q->conv_fft.pss_signal_time[N_id_2] = q->pss_signal_time[N_id_2];
if (srslte_conv_fft_cc_init(&q->conv_fft, frame_size, fft_size, q->pss_signal_time, )) {
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)) {
fprintf(stderr, "Error initiating convolution FFT\n");
goto clean_and_exit;
}
@ -210,6 +209,9 @@ void srslte_pss_synch_free(srslte_pss_synch_t *q) {
if (q->pss_signal_time[i]) {
free(q->pss_signal_time[i]);
}
if(q->pss_signal_freq_full[i]){
free(q->pss_signal_freq_full[i]);
}
}
#ifdef CONVOLUTION_FFT
srslte_conv_fft_cc_free(&q->conv_fft);
@ -351,11 +353,11 @@ int srslte_pss_synch_find_pss(srslte_pss_synch_t *q, cf_t *input, float *corr_pe
if(q->decimate > 1)
{
srslte_filt_decim_cc_execute(&(q->filter), q->tmp_input, q->filter.downsampled_input, q->filter.filter_output , (q->frame_size * q->decimate));
conv_output_len = srslte_conv_fft_cc_run_opt(&q->conv_fft, q->filter.filter_output, q->N_id_2, q->conv_output);
conv_output_len = srslte_conv_fft_cc_run_opt(&q->conv_fft, q->filter.filter_output,q->pss_signal_freq_full[q->N_id_2], q->conv_output);
}
else
{
conv_output_len = srslte_conv_fft_cc_run_opt(&q->conv_fft, q->tmp_input, q->N_id_2, q->conv_output);
conv_output_len = srslte_conv_fft_cc_run_opt(&q->conv_fft, q->tmp_input, q->pss_signal_freq_full[q->N_id_2], q->conv_output);
}
#else

@ -70,6 +70,7 @@ int srslte_conv_fft_cc_init_opt(srslte_conv_fft_cc_t *q, uint32_t input_len, uin
{
srslte_dft_run_c(&q->filter_plan, filter_time[i], filter_freq[i]);
}
printf("optimization being used\n");
}
return SRSLTE_SUCCESS;
}
@ -84,10 +85,6 @@ void srslte_conv_fft_cc_free(srslte_conv_fft_cc_t *q) {
if (q->output_fft) {
free(q->output_fft);
}
for(int i = 0; i < 3;i++)
{
free(q->pss_signal_time_fft[i]);
}
srslte_dft_plan_free(&q->input_plan);
srslte_dft_plan_free(&q->filter_plan);
@ -97,7 +94,7 @@ void srslte_conv_fft_cc_free(srslte_conv_fft_cc_t *q) {
}
uint32_t srslte_conv_fft_cc_run_opt(srslte_conv_fft_cc_t *q, cf_t *input,cf_t *filter_freq, cf_t *output)
uint32_t srslte_conv_fft_cc_run_opt(srslte_conv_fft_cc_t *q, cf_t *input, cf_t *filter_freq, cf_t *output)
{
srslte_dft_run_c(&q->input_plan, input, q->input_fft);
srslte_vec_prod_ccc(q->input_fft, filter_freq, q->output_fft, q->output_len);

Loading…
Cancel
Save