EasyManuals Logo

Keysight Technologies X Series Programming Guide

Keysight Technologies X Series
398 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 #283 background imageLoading...
Page #283 background image
Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide 283
Creating and Downloading Waveform Files
Programming Examples
Calculating the RMS Voltage for a Waveform Programming Using C++
This example calculates the RMS voltage value of a waveform segment stored
as 16-bit alternating I/Q twos complement DAC values. Refer to the User’s
Guide. This example is named: “calculate_rms_data_c++.txt” and is not
included on the Documentation CD.
#include <math.h>
#ifndef WIN32
typedef long long int int64;
typedef long long unsigned uint64;
#else // WIN32
typedef __int64 int64;
typedef unsigned __int64 uint64;
#endif // WIN32
static const int NUM_DAC_BITS=16;
static const int DAC_MAX=(1 << NUM_DAC_BITS);
//-----------------------------------------------------------------
// calculates the rms of a chunk of a waveform stored as 16-bit
alternating
// I/Q twos complement DAC values.
// NOTE: short must be a 16 bit quantity.
// Also NOTE: For 4Gsa or more, samples must be an int64.
double
calcRmsWaveformSegment(const signed short* iq_data, unsigned
samples)
{
// a double cannot hold the full number accurately for very long
waveforms
// This type can handle up to (but not including) 8Gsa.
For a short the value must be a 16 bit quantity.
For waveforms of 4 Gsa or more, samples must be an int64.
Internally, the MXG ignores two or more zeros in a row when calculating
RMS voltage values.
There is no interface version of this example in the Programming Examples
chapter.

Table of Contents

Other manuals for Keysight Technologies X Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Keysight Technologies X Series and is the answer not in the manual?

Keysight Technologies X Series Specifications

General IconGeneral
BrandKeysight Technologies
ModelX Series
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals