240 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Creating and Downloading Waveform Files
Creating Waveform Data
To download the data created in the above example, see “Using Advanced
Programming Languages” on page 243.
Line Code—Interleaving I and Q data for Big Endian Order
20
21
22
23
24
25
26
short iqbuffer[NUMSAMPLES*2];
for(index=0; index<numsamples; index++)
{
iqbuffer[index*2] = idata[index];
iqbuffer[index*2+1] = qdata[index];
}
return 0;
Line Code Description—Interleaving I and Q data for Big Endian Order
20 Define a 16–bit integer (short) array to store the interleaved I and Q data. The array size increases by two times
to accommodate two bytes of I data and two bytes of Q data.
NOTE In rare instances, a compiler may define short as larger than 16 bits. If this
condition exists, replace short with the appropriate object or label that defines a
16–bit integer.
21–25 Create a loop to do the following:
— Store the I data values to the I/Q array location [index*2].
— Store the Q data values to the I/Q array location [index*2+1].
10110111
15...................... 8
Data
Bit Position
Interleaved I/Q Array in Big Endian Order
11101001
7.................... 0
11100101
15...................... 8
01101011
7.................... 0
I Data
Q Data