EasyManuals Logo

Agilent Technologies N5182A Programming Guide

Agilent Technologies N5182A
366 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #244 background imageLoading...
Page #244 background image
234 Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide
Creating and Downloading Waveform Files
Programming Examples
// Find the Maximum amplitude in I and Q to normalize the data between +-1
maxAmp = Iwave[0];
minAmp = Iwave[0];
for( i=0; i<points; i++)
{
if( maxAmp < Iwave[i] )
maxAmp = Iwave[i];
else if( minAmp > Iwave[i] )
minAmp = Iwave[i];
if( maxAmp < Qwave[i] )
maxAmp = Qwave[i];
else if( minAmp > Qwave[i] )
minAmp = Qwave[i];
}
maxAmp = fabs(maxAmp);
minAmp = fabs(minAmp);
if( minAmp > maxAmp )
maxAmp = minAmp;
// Convert to short integers and interleave I/Q data
scale = 32767 / maxAmp; // Watch out for divide by zero.
for( i=0; i<points; i++)
{
waveform[2*i] = (short)floor(Iwave[i]*scale + 0.5);
waveform[2*i+1] = (short)floor(Qwave[i]*scale + 0.5);
}
// If on a PC swap the bytes to Big Endian
if( strcmp(computer,”PCWIN”) == 0 )
//if( PC )
{
pChar = (char *)&waveform[0]; // Character pointer to short int data
for( i=0; i<2*points; i++ )
{
buf = *pChar;
*pChar = *(pChar+1);
*(pChar+1) = buf;
pChar+= 2;
}
}
// Save the data to a file
// Use FTP or one of the download assistants to download the file to the

Table of Contents

Other manuals for Agilent Technologies N5182A

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Agilent Technologies N5182A and is the answer not in the manual?

Agilent Technologies N5182A Specifications

General IconGeneral
BrandAgilent Technologies
ModelN5182A
CategoryPortable Generator
LanguageEnglish

Related product manuals