![HP E4401B Programmer'S Manual Download Page 143](http://html.mh-extra.com/html/hp/e4401b/e4401b_programmers-manual_161548143.webp)
Chapter 3
3-79
Programming Examples
Measuring Harmonic Distortion (RS-232)
• Take a sweep and wait for the sweep completion.
• Check for operation complete.
• Read the marker amplitude in volts, This is the fundamental
amplitude in volts.
• Read the marker frequency.
• Change the center frequency step size equal to the marker
frequency.
• Measure each harmonic amplitude as follows:
• Set the span to 20 MHz.
• Increment the center frequency. The new center frequency should
roughly equal the frequency of the next harmonic.
• Take a sweep and wait for completion.
• Perform a peak search and wait for completion.
• Activate signal track.
• Zoom down to a 100 kHz span.
• Take a sweep and wait for the sweep completion.
• Signal track off.
• Perform a peak search and wait for completion.
• Set Marker Amplitude in volts.
• Query and read the marker amplitude in volts.
• Change the amplitude units to dBm and read the marker
amplitude.
• Calculate the relative amplitude of each harmonic relative to the
fundamental.
• Calculate the total harmonic distortion.
• Display Fundamental amplitude in dBm, fundamental frequency in
MHz, relative amplitude of each harmonic in dBc, and total
harmonic distortion in percent.
• Close the Session.
Example:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <conio.h>
#include <ctype.h>
#include <string.h>
Summary of Contents for E4401B
Page 6: ...vi ...
Page 14: ...xiv Contents ...
Page 64: ...2 34 Chapter2 HP ESA Status Registers Using the Analyzer Status Registers ...
Page 65: ...3 1 3 Programming Examples ...
Page 151: ...4 1 4 Programming Command Cross References ...
Page 286: ...5 132 Chapter5 Language Reference UNIT Subsystem ...
Page 287: ...6 1 6 HP 8590 HP ESA Spectrum Analyzers Programming Conversion Guide ...
Page 292: ...1 HP 8590 HP ESA Spectrum Analyzers Conversion Guide ...
Page 368: ...7 1 7 Error Messages ...
Page 393: ...7 26 Chapter7 Error Messages 201 to 799 Device Specific Errors ...