HP ESA-E Series Programmer's Manual page 117

Esa spectrum analyzers
Table of Contents

Advertisement

/*Remove the "," token from the amplitude correction for
analyzing data*/
cToken = strtok(cResult,",");
/*Store the array (frequency) value into a
two-dimensional real array*/
aRealArray[lFreq=0][lCount=0] = atof( cToken);
/*Remove the "," token from the amplitude correction for
analyzing data*/
cToken =strtok(NULL,",");
/*Store the array(amplitude) value into a
two-dimensional real array*/
aRealArray[lAmpltd=1][lCount] = atof(cToken);
while (cToken != NULL)
{
lCount++;
if (lCount == iNoOfPoints)
{
lCount --;
break;
}
/*Remove the "," token from the amplitude correction
for analyzing data*/
cToken =strtok(NULL,",");
/*Store the array(frequency) value into a
two-dimensional real array*/
aRealArray[lFreq][lCount] = atof(cToken);
cToken =strtok(NULL,",");
/*Store the array(amplitude) value into a
two-dimensional real array*/
aRealArray[lAmpltd][lCount] = atof(cToken);
}
/*Display the contents of the array*/
for (long i=0;i<=lCount;i++)
{
printf("\tFrequency of point[%d] = %f
Mhz\n",i,aRealArray[lFreq][i]/1e6);
printf("\tAmplitude of point[%d] = %f
dBm\n",i,aRealArray[lAmpltd][i]);
}
Chapter 3
Programming Examples
Entering Amplitude Correction Data
3-53

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents