Vector Optimized Library of Kernels 3.1.0
Architecture-tuned implementations of math kernels
volk_32i_s32f_convert_32f

Overview

Converts the samples in the inputVector from 32-bit integers into floating point values and then divides them by the input scalar.

Dispatcher Prototype

void volk_32i_s32f_convert_32f(float* outputVector, const int32_t* inputVector, const
float scalar, unsigned int num_points)

Inputs

  • inputVector: The vector of 32-bit integers.
  • scalar: The value that the output is divided by after being converted to a float.
  • num_points: The number of values.

Outputs

  • complexVector: The output vector of floats.

Example Convert full-range integers to floats in range [0,1].

int N = 1<<8;
unsigned int alignment = volk_get_alignment();
int32_t* x = (int32_t*)volk_malloc(N*sizeof(int32_t), alignment);
float* z = (float*)volk_malloc(N*sizeof(float), alignment);
float scale = (float)N;
for(unsigned int ii=0; ii<N; ++ii){
x[ii] = ii;
}
volk_32i_s32f_convert_32f(z, x, scale, N);