Loading...
Searching...
No Matches
volk_32fc_index_min_16u

Overview

Returns Argmin_i mag(x[i]). Finds and returns the index which contains the minimum magnitude for complex points in the given vector.

Note that num_points is a uint32_t, but the return value is uint16_t. Providing a vector larger than the max of a uint16_t (65536) would miss anything outside of this boundary. The kernel will check the length of num_points and cap it to this max value, anyways.

Dispatcher Prototype

void volk_32fc_index_min_16u(uint16_t* target, const lv_32fc_t* source, uint32_t
num_points)

Inputs

- source: The complex input vector.
- num_points: The number of samples.

Outputs

- target: The index of the point with minimum magnitude.

Example Calculate the index of the minimum value of for points around the unit circle.

int N = 10;
uint32_t alignment = volk_get_alignment();
lv_32fc_t* in = (lv_32fc_t*)volk_malloc(sizeof(lv_32fc_t)*N, alignment);
uint16_t* min = (uint16_t*)volk_malloc(sizeof(uint16_t), alignment);
for(uint32_t ii = 0; ii < N/2; ++ii){
float real = 2.f * ((float)ii / (float)N) - 1.f;
float imag = std::sqrt(1.f - real * real);
in[ii] = lv_cmake(real, imag);
in[ii] = in[ii] * in[ii] + in[ii];
in[N-ii] = lv_cmake(real, imag);
in[N-ii] = in[N-ii] * in[N-ii] + in[N-ii];
}
volk_32fc_index_min_16u(min, in, N);
printf("index of min value = %u\n", *min);
volk_free(in);
volk_free(min);