Agilent Technologies E8663B Portable Generator User Manual


 
218 Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide
Creating and Downloading Waveform Files
Downloading Waveform Data
To download the data created in the above example, see “Using Advanced Programming Languages”
on page 221.
Downloading Waveform Data
This section examines methods of downloading I/Q waveform data created in MATLAB (a simulation
software) and C++ (an advanced programming language). For more information on simulation and
advanced programming environments, see “Creating Waveform Data” on page 212.
To download data from simulation software environments, it is typically easier to use one of the free
download utilities (described on page 227), because simulation software usually saves the data to a
file. In MATLAB however, you can either save data to a .mat file or create a complex array. To
facilitate downloading a MATLAB complex data array, Agilent created the Agilent Waveform
Download Assistant (one of the free download utilities), which downloads the complex data array
from within the MATLAB environment. This section shows how to use the Waveform Download
Assistant.
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