Vector Optimized Library of Kernels  3.0.0
Architecture-tuned implementations of math kernels

Overview

This block computes the conjugate dot product (or inner product) between two vectors, the input and taps vectors. Given a set of num_points taps, the result is the sum of products between the input vector and the conjugate of the taps. The result is a single value stored in the result address and is returned as a complex float.

Dispatcher Prototype

void volk_32fc_x2_conjugate_dot_prod_32fc(lv_32fc_t* result, const lv_32fc_t* input,
const lv_32fc_t* taps, unsigned int num_points)
float complex lv_32fc_t
Definition: volk_complex.h:74

Inputs

  • input: vector of complex floats.
  • taps: complex float taps.
  • num_points: number of samples in both input and taps.

Outputs

  • result: pointer to a complex float value to hold the dot product result.

Example

unsigned int N = 1000;
unsigned int alignment = volk_get_alignment();
lv_32fc_t* a = (lv_32fc_t*) volk_malloc(sizeof(lv_32fc_t) * N, alignment);
lv_32fc_t* b = (lv_32fc_t*) volk_malloc(sizeof(lv_32fc_t) * N, alignment);
for (int i = 0; i < N; ++i) {
a[i] = lv_cmake(.50f, .50f);
b[i] = lv_cmake(.50f, .75f);
}
lv_32fc_t e = (float) N * a[0] * lv_conj(b[0]); // When a and b constant
volk_32fc_x2_conjugate_dot_prod_32fc(&res, a, b, N);
printf("Expected: %8.2f%+8.2fi\n", lv_real(e), lv_imag(e));
printf("Result: %8.2f%+8.2fi\n", lv_real(res), lv_imag(res));
size_t volk_get_alignment(void)
Get the machine alignment in bytes.
Definition: volk.tmpl.c:90
#define lv_conj(x)
Definition: volk_complex.h:100
#define lv_cmake(r, i)
Definition: volk_complex.h:77
for i
Definition: volk_config_fixed.tmpl.h:13
__VOLK_DECL_BEGIN VOLK_API void * volk_malloc(size_t size, size_t alignment)
Allocate size bytes of data aligned to alignment.
Definition: volk_malloc.c:38
VOLK_API void volk_free(void *aptr)
Free's memory allocated by volk_malloc.
Definition: volk_malloc.c:80