add simple cross-correlation method

- implements a cross-correlation that takes the complex conjugate
  of one of the input signals (filter)
- the fft of this input signal is only computed once
master
Andre Puschmann 6 years ago
parent 13c17ad9e7
commit e647dac3e4

@ -61,10 +61,14 @@ SRSLTE_API int srslte_conv_fft_cc_replan(srslte_conv_fft_cc_t *q,
SRSLTE_API void srslte_conv_fft_cc_free(srslte_conv_fft_cc_t *q); 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, SRSLTE_API uint32_t srslte_corr_fft_cc_run(srslte_conv_fft_cc_t* q, cf_t* input, cf_t* filter, cf_t* output);
const cf_t *input,
const cf_t *filter, SRSLTE_API uint32_t srslte_corr_fft_cc_run_opt(srslte_conv_fft_cc_t* q, cf_t* input, cf_t* filter, cf_t* output);
cf_t *output);
SRSLTE_API uint32_t srslte_conv_fft_cc_run(srslte_conv_fft_cc_t* q,
const cf_t* input,
const cf_t* filter,
cf_t* output);
SRSLTE_API uint32_t srslte_conv_fft_cc_run_opt(srslte_conv_fft_cc_t *q, SRSLTE_API uint32_t srslte_conv_fft_cc_run_opt(srslte_conv_fft_cc_t *q,
const cf_t *input, const cf_t *input,

@ -127,6 +127,20 @@ uint32_t srslte_conv_fft_cc_run(srslte_conv_fft_cc_t *q, const cf_t *input, cons
} }
uint32_t srslte_corr_fft_cc_run_opt(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_vec_prod_conj_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);
}
uint32_t srslte_corr_fft_cc_run(srslte_conv_fft_cc_t* q, cf_t* input, cf_t* filter, cf_t* output)
{
srslte_dft_run_c(&q->filter_plan, filter, q->filter_fft);
return srslte_corr_fft_cc_run_opt(q, input, q->filter_fft, output);
}
uint32_t srslte_conv_cc(const cf_t *input, const cf_t *filter, cf_t *output, uint32_t input_len, uint32_t filter_len) { uint32_t srslte_conv_cc(const cf_t *input, const cf_t *filter, cf_t *output, uint32_t input_len, uint32_t filter_len) {
uint32_t i; uint32_t i;
uint32_t M = filter_len; uint32_t M = filter_len;

Loading…
Cancel
Save