GNU Radio Manual and C++ API Reference  3.7.7
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages

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)

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;
unsigned int alignment = volk_get_alignment();
float* imag = (float*)volk_malloc(sizeof(float)*N, alignment);
float* real = (float*)volk_malloc(sizeof(float)*N, alignment);
lv_16sc_t* out = (lv_16sc_t*)volk_malloc(sizeof(lv_16sc_t)*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]);
}
// Normalize by smallest delta (0.02 in this example)
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]));
}
volk_free(imag);
volk_free(real);
volk_free(out);