Loading...
Searching...
No Matches
volk_32f_binary_slicer_32i

Overview

Slices input floats and and returns 1 when the input >= 0 and 0 when < 0. Results are returned as 32-bit ints.

Dispatcher Prototype

void volk_32f_binary_slicer_32i(int* cVector, const float* aVector, unsigned int
num_points)

Inputs

- aVector: The input vector of floats.
- num_points: The number of data points.

Outputs

- cVector: The output vector of 32-bit ints.

Example Generate ints of a 7-bit barker code from floats.

int N = 7;
unsigned int alignment = volk_get_alignment();
float* in = (float*)volk_malloc(sizeof(float)*N, alignment);
int32_t* out = (int32_t*)volk_malloc(sizeof(int32_t)*N, alignment);
in[0] = 0.9f;
in[1] = 1.1f;
in[2] = 0.4f;
in[3] = -0.7f;
in[5] = -1.2f;
in[6] = 0.2f;
in[7] = -0.8f;
volk_32f_binary_slicer_32i(out, in, N);
for(unsigned int ii = 0; ii < N; ++ii){
printf("out(%i) = %i\n", ii, out[ii]);
}
volk_free(in);
volk_free(out);