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

Overview

Multiplies two complex vectors and returns the complex result.

Dispatcher Prototype

void volk_32fc_x2_multiply_32fc(lv_32fc_t* cVector, const lv_32fc_t* aVector, const
lv_32fc_t* bVector, unsigned int num_points);
float complex lv_32fc_t
Definition: volk_complex.h:74

Inputs

  • aVector: The first input vector of complex floats.
  • bVector: The second input vector of complex floats.
  • num_points: The number of data points.

Outputs

  • outputVector: The output vector complex floats.

Example Mix two signals at f=0.3 and 0.1.

int N = 10;
unsigned int alignment = volk_get_alignment();
lv_32fc_t* sig_1 = (lv_32fc_t*)volk_malloc(sizeof(lv_32fc_t)*N, alignment);
lv_32fc_t* sig_2 = (lv_32fc_t*)volk_malloc(sizeof(lv_32fc_t)*N, alignment);
lv_32fc_t* out = (lv_32fc_t*)volk_malloc(sizeof(lv_32fc_t)*N, alignment);
for(unsigned int ii = 0; ii < N; ++ii){
// Generate two tones
float real_1 = std::cos(0.3f * (float)ii);
float imag_1 = std::sin(0.3f * (float)ii);
sig_1[ii] = lv_cmake(real_1, imag_1);
float real_2 = std::cos(0.1f * (float)ii);
float imag_2 = std::sin(0.1f * (float)ii);
sig_2[ii] = lv_cmake(real_2, imag_2);
}
volk_32fc_x2_multiply_32fc(out, sig_1, sig_2, N);
*
volk_free(sig_1);
volk_free(sig_2);
volk_free(out);
size_t volk_get_alignment(void)
Get the machine alignment in bytes.
Definition: volk.tmpl.c:90
#define lv_cmake(r, i)
Definition: volk_complex.h:77
__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