Loading...
Searching...
No Matches
volk_32fc_x2_s32fc_multiply_conjugate_add_32fc

Deprecation

This kernel is deprecated, because passing in lv_32fc_t by value results in Undefined Behaviour, causing a segmentation fault on some architectures. Use volk_32fc_x2_s32fc_multiply_conjugate_add2_32fc instead.

Overview

Conjugate the input complex vector, multiply them by a complex scalar, add the another input complex vector and returns the results.

c[i] = a[i] + conj(b[i]) * scalar

Dispatcher Prototype

void volk_32fc_x2_s32fc_multiply_conjugate_add_32fc(lv_32fc_t* cVector, const
lv_32fc_t* aVector, const lv_32fc_t* bVector, const lv_32fc_t scalar, unsigned int
num_points);

Inputs

- aVector: The input vector to be added.
- bVector: The input vector to be conjugate and multiplied.
- scalar: The complex scalar to multiply against conjugated bVector.
- num_points: The number of complex values in aVector and bVector to be conjugate, multiplied and stored into cVector.

Outputs

- cVector: The vector where the results will be stored.

Example Calculate coefficients.

int n_filter = 2 * N + 1;
unsigned int alignment = volk_get_alignment();
// state is a queue of input IQ data.
lv_32fc_t* state = (lv_32fc_t*)volk_malloc(sizeof(lv_32fc_t) * n_filter, alignment);
// weight and next one.
lv_32fc_t* weight = (lv_32fc_t*)volk_malloc(sizeof(lv_32fc_t) * n_filter, alignment);
lv_32fc_t* next = (lv_32fc_t*)volk_malloc(sizeof(lv_32fc_t) * n_filter, alignment);
...
// push back input IQ data into state.
foo_push_back_queue(state, input);
// get filtered output.
lv_32fc_t output = lv_cmake(0.f,0.f);
for (int i = 0; i < n_filter; i++) {
output += state[i] * weight[i];
}
// update weight using output.
float real = lv_creal(output) * (1.0 - std::norm(output)) * MU;
lv_32fc_t factor = lv_cmake(real, 0.f);
volk_32fc_x2_s32fc_multiply_conjugate_add_32fc(next, weight, state, factor, n_filter);
lv_32fc_t *tmp = next;
next = weight;
weight = tmp;
weight[N + 1] = lv_cmake(lv_creal(weight[N + 1]), 0.f);
...
volk_free(state);
volk_free(weight);
volk_free(next);