Waveform (Ripple) Analysis Library

Other topics about VBA Programming

Overview

By combining the COM objects provided for the E5071C and the ripple analysis library, you can easily perform the ripple analysis of waveforms.

Flow of Programming using Ripple Analysis Library

Below table shows the flow of program development using the ripple analysis library. First, set up the analysis range and peak definition to use the procedures for ripple analysis.

  1. Condition setting before using the ripple analysis library

  2. Using the ripple analysis library

Condition Setting before using Ripple Analysis Library

Since the analysis conditions are not specified in the ripple analysis library, before using the procedure for ripple analysis, set up the analysis range and the peak definition using COM objects.

Specifying the Analysis Range

Use the following COM objects to specify the analysis range for ripple analysis.

Setting the Peak Definition

Use the following COM objects to set up the peak definition for ripple analysis.

List of Ripple Analysis Library

Use the provided procedures for ripple analysis to analyze the ripple of waveforms and output the result. All procedures perform analysis only within the stimulus range for the specified channel.

Function Name

Description

MaxPeakToPeak(Chan)

 

Returns the maximum value of the difference between a positive peak and a negative peak

MaxRightGap(Chan)

Returns the maximum value of the difference between a positive peak and its right adjacent negative peak.

MaxLeftGap(Chan)

 

Returns the maximum value of the difference between a positive peak and its left adjacent negative peak.

MaxGap(Chan)

 

Returns the maximum value of the difference between a positive peak and its adjacent negative peak.

MaxEnvelopeGap(Chan)

Returns the maximum value of the vertical distance between a line segment connecting 2 adjacent positive peaks and the negative peak between them.

GapMean(Chan)

 

Returns the mean value of the differences between a negative peak and its right and left adjacent positive peaks.

MaxRippleValue(Chan)

Returns the maximum value of the total of the differences between a negative peak and its right and left adjacent positive peaks.

MaxRipplePoint(Chan,Stim)

Returns the maximum value of the total of the differences between a negative peak and its right and left adjacent positive peaks and the stimulus value (Stim) of the valley of the ripple.

Pole(Chan,D,LeftStim,LeftValue,
RightStim,RightValue)

Returns the values (LeftValue and RightValue) and the stimulus values (LeftStimulus and RightStimulus) of the right and left negative peaks detected first below the specified value (D) relative to the maximum value.

FirstRightGap(Chan)

Returns the difference between the positive peak detected first when searched from the left edge toward the right edge and its right adjacent negative peak.

FirstLeftGap(Chan)

 

Returns the difference between the positive peak detected first when searched from the right edge toward the left edge and its left adjacent negative peak.

FirstRightInterval(Chan)

Returns the difference of the stimulus value between the positive peak detected first when searched from the left edge toward the right edge and its right adjacent negative peak.

FirstLeftInterval(Chan)

Returns the difference of the stimulus value between the positive peak detected first when searched from the left edge toward the right edge and its left adjacent negative peak.

Sample Program

Here is a simple sample program using the ripple analysis procedures.

Sub Sample()

Dim Val As Double      (1)

SCPI.CALCulate(1).SELected.FUNCtion.PEXCursion = 1.5      (2)
SCPI.CALCulate(1).SELected.FUNCtion.PPOLarity = "BOTH"      (2)
SCPI.CALCulate(1).SELected.FUNCtion.DOMain.STARt = 935E6      (3)
SCPI.CALCulate(1).SELected.FUNCtion.DOMain.STOP = 960E6      (3)
SCPI.CALCulate(1).SELected.FUNCtion.DOMain.STATe = True      (3)
   
·   
   
·   
Val = MaxPeakToPeak(1)       (4)

End Sub

Let us break down the code into a number of blocks and see what they do.

  1. Defines a variable Val as Double.

  2. Sets the lower limit of the peak excursion value and polarity for the peak search to 1.5 and both of positive peak and negative peak, respectively.

  3. Sets the analysis range for channel 1 to 935 MHz to 960 MHz.

  4. For channel 1, substitutes the return value from the MaxPeakToPeak function (procedure) in the ripple analysis library to the Val variable.