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

Overview

Divide first vector of complexes element-wise by second.

Dispatcher Prototype

void volk_32fc_x2_divide_32fc(lv_32fc_t* cVector, const lv_32fc_t* numeratorVector, const lv_32fc_t* denumeratorVector, unsigned int num_points);

Inputs

  • numeratorVector: The numerator complex values.
  • numeratorVector: The denumerator complex values.
  • num_points: The number of data points.

Outputs

  • outputVector: The output vector complex floats.

Example divide a complex vector by itself, demonstrating the result should be pretty close to 1+0j.

int N = 10;
unsigned int alignment = volk_get_alignment();
lv_32fc_t* input_vector = (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);
float delta = 2.f*M_PI / (float)N;
for(unsigned int ii = 0; ii < N; ++ii){
float real_1 = std::cos(0.3f * (float)ii);
float imag_1 = std::sin(0.3f * (float)ii);
input_vector[ii] = lv_cmake(real_1, imag_1);
}
volk_32fc_x2_divide_32fc(out, input_vector, input_vector, N);
for(unsigned int ii = 0; ii < N; ++ii){
printf("%1.4f%+1.4fj,", lv_creal(out[ii]), lv_cimag(out[ii]));
}
printf("\n");
volk_free(input_vector);
volk_free(out);