next up previous contents index
Next: Post-Measurement Commands Up: The measure Command Previous: Syntax Compatibility   Contents   Index


Measurements

One should be aware that measurements are performed using data saved in the plot structure as a simulation progresses. The accuracy of the results is directly affected by the density of saved points. In transient analysis, one may wish to use internal time point data by setting the steptype=nousertp option. This avoids the interpolation to tranient time increments which may reduce accuracy if the increment is too coarse.

The following measurements are available when an interval has been specified.

find expr
Evaluate the difference: expr at target minus expr at trigger.
min expr
Find the minimum value of expr.
max expr
Find the maximum value of expr.
pp expr
Find the (maximum - minimum) value of expr.
avg expr
Compute the average of expr.
rms expr
Compute the rms value of expr.
pw expr
This will measure the full-width half-maximum of a pulse contained in the interval. The baseline is taken as the initial or final value with the smallest difference from the peak value. The algorithm will measure the larger of a negative going or positive going pulse.
rt expr [firstval secondval]
This will measure the rise or fall time of the edge contained in the interval. The optional following two numbers are the measurement thresholds, which default to 0.1 and 0.9 if not given. The reference start and final values are the values at the ends of the interval.

These functions are also available in general expressions outside of the measure command:

mmin,
mmax,
mpp,
mavg,
mrms,
mpw,
mrft,
mrft2.

Each of these functions other than mrft2 takes three arguments: (vector, scaleval1, scaleval2). The mrft2 function tackes the same arguments, but in addition accepts two additional real numbers representing the transition thresholds that would replace 0.1 and 0.9 used for rise/fall time measurement in the mrft function. The mrft2 function is otherwise identical to mrft. The two scale values frame the area of measurement. These must be chosen to isolate the feature of interest for rise/fall/width measurement. If not in range of the vector scale, the vector scale endpoints are assumed.

When a point has been specified, the only measurement form available is

find expr
Evaluate expr at point.

A measure command line or .measure statement can contain any number of measurements, including no measurements. If no measurement is specified, the vector produced contains only zeros, however the scale vector contains the start and stop values, which may be the only result needed. The created vector, which is added to the current plot, will be of length equal to the number of measurements, with the results placed in the vector in order.

The measurement scale point(s) in measure commands and .measure statements are also saved in a vector, which is the scale for the result vector. If the measurement name is ``result'', then the scale vector is named ``result_scale''. The scale contains one or two values, depending on whether it is a point or interval measurement.


next up previous contents index
Next: Post-Measurement Commands Up: The measure Command Previous: Syntax Compatibility   Contents   Index
Stephen R. Whiteley 2024-10-26