Keysight E4428C ESG RF Programming Manual page 287

Signal generators
Table of Contents

Advertisement

// This is a text file to which we will write the
// I and Q data just for debugging purposes.
// a good programming practice to check your data
// in this way before attempting to write it to
// the instrument.
char *ofile = "c:\\SignalGenerator\\data\\iq.txt";
// Create arrays to hold the I and Q data
int idata[MAXSAMPLES];
int qdata[MAXSAMPLES];
// Often we must modify, scale, or offset the data
// before loading it into the instrument.
// buffers are used for that purpose.
// sample is 16 bits, and a character only holds
// 8 bits, we must make these arrays twice as long
// as the I and Q data arrays.
char ibuffer[MAXSAMPLES*2];
char qbuffer[MAXSAMPLES*2];
// For the E4438C or E8267C/67D, we might also need to interleave
// the I and Q data.
// purpose.
In this case, this buffer must hold
// both I and Q data so it needs to be four times
// as big as the data arrays.
char iqbuffer[MAXSAMPLES*4];
// Declare variables which will be used later
bool done;
FILE *infile;
int index, numsamples, i1, i2, ivalue;
// In this example, we'll assume the data files have
// the I and Q data in binary form as unsigned 16 bit integers.
// This next block reads those binary files.
// data is in some other format, then replace this block
// with appropriate code for reading your format.
// First read I values
done = false;
index = 0;
infile = fopen(ifile, "rb");
if (infile==NULL) perror ("Error opening file to read");
Keysight Signal Generators Programming Guide
These
Since each
This buffer is used for that
It is
If your
Creating and Downloading Waveform Files
Programming Examples
279

Advertisement

Table of Contents
loading

Table of Contents