Overview
Takes input vector iBuffer as the real (inphase) part and input vector qBuffer as the imag (quadrature) part and combines them into a complex output vector. The output is scaled by the input scalar value and convert to a 16-bit short comlex number.
Dispatcher Prototype
void volk_32f_x2_s32f_interleave_16ic(
lv_16sc_t* complexVector,
const float* iBuffer,
const float* qBuffer, const float scalar, unsigned int num_points)
short complex lv_16sc_t
Definition: volk_complex.h:71
Inputs
- iBuffer: Input vector of samples for the real part.
- qBuffer: Input vector of samples for the imaginary part. \;i scalar: The scalar value used to scale the values before converting to shorts.
- num_points: The number of values in both input vectors.
Outputs
- complexVector: The output vector of complex numbers.
Example Generate points around the unit circle and convert to complex integers.
int N = 10;
float* imag = (
float*)
volk_malloc(
sizeof(
float)*N, alignment);
float* real = (
float*)
volk_malloc(
sizeof(
float)*N, alignment);
for(unsigned int ii = 0; ii < N; ++ii){
real[ii] = 2.f * ((float)ii / (float)N) - 1.f;
imag[ii] = std::sqrt(1.f - real[ii] * real[ii]);
}
float scale = 50.f;
volk_32f_x2_s32f_interleave_16ic(out, imag, real, scale, N);
for(unsigned int ii = 0; ii < N; ++ii){
printf("out[%u] = %i + %ij\n", ii, std::real(out[ii]), std::imag(out[ii]));
}
size_t volk_get_alignment(void)
Get the machine alignment in bytes.
Definition: volk.tmpl.c:90
__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