2.1.10 addtool_rise_time(Pro)

Menu Information

Gadgets: Rise Time

Brief Information

Calculate rise or fall time of data plot within a region of interest

Additional Information

This feature is for OriginPro only, updated in 8.1 SR1.

Command Line Usage

addtool_rise_time trGUI.rectcolor:=21 trGUI.tool:=1 trGUI.method:=1 trGUI.output_to.reslog:=1 trGUI.display.risetime:=1;

X-Function Execution Options

Please refer to the page for additional option switches when accessing the x-function from script

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Settings trGUI

Input

TreeNode

<unassigned>

It can be used to customize the computation options.

Please see more details in the Description section.

Description

Rise time (or fall time) refers to the time required for a signal to change from a specified low value to a specified high value (or from a specified high value to a specified low value). Typically, these values are 10% and 90% of the step height. This function allows you to select an area on the graph intuitively with a rectangle that is added to the graph and calculate the rise time or fall time within the area.

In a step-like signal, a low state level and a high state level are calculated. Then the step height can be calculated by deducting the low state level from the high state level. Then a low reference level and a high reference level are calculated with two specified percentages of the step height. Finally, we can locate the rise time (or fall time) span and calculate the time required for the signal to rise from the low reference level to the high reference level (or drop from the high reference level to the high reference level). The relationships of these parameters are shown in the picture below.

Addtool rise time-5.png

Details for Dialog Settings

Settings(trGUI)

The trGUI tree specifies all setting options for the addtool_rise_time X-Function.

Syntax: trGUI.Treenode:=<value>

Example: trGUI.rectcolor:=23

Treenode Label Type Default Description
rectcolor Color Input int 21 Specify the color of the rectangle which is attached to the graph. With this rectangle, you can select an area on the graph to apply the rise time/fall time analysis. For the choice of the color, see the list of colors.
tool Tool Input int 0 Specify whether rise time or fall time should be computed. Options include:
  • 0:Rise time
Rise time analysis is being applied. The tool will calculate the time required for the signal to rise from the low reference level to the high reference level.
  • 1:Fall time
Fall time analysis is being applied. The tool will calculate the time required for the signal to drop from the high reference level to the low reference level.
method Method Input int 0 Specify the method applied to locate the rise time/fall time span. It is unavailable when both high state level and low state level are specified manually. Options include:
  • 0:Linear Search
Use the Linear Search method for the rise or fall time analysis. Please read the details in the Algorithm section below.
  • 1:Histogram
Use the Histogram method for the rise or fall time analysis. Please read the details in the Algorithm section below.
  • 2:Largest Triangle
Use the Largest Triangle method for the rise or fall time analysis. Please read the details in the Algorithm section below. When this method is selected, the High State Level and Low State Level cannot be specified manually.
input Rise Range/Fall Range Input TreeNode <unassigned> Specify the high/low state level and the ratio of the high/low reference level to the step high. See more details in the Rise Range/Fall Range Subtree table below.
output Quantities Input TreeNode <unassigned> Specify the quantities to output. See more details in the Quantities Subtree table below.
output_to Output To Input TreeNode <unassigned> Specify where to output the results. See more details in the Output To Subtree table below.
display Display on Graph Input TreeNode <unassigned> Specify the properties of the display of indicators, state levels, rise/fall time and rise/fall range on the graph. See more details in the Display on Graph Subtree table below.
adv Advanced Input TreeNode <unassigned> Advanced settings about the smoothing operation performed before the analysis and the parameters used in the searching method, noise level unit, and how to control results when graph scale changes. See more details in the Advanced Subtree table below.

Rise Range/Fall Range Subtree

Specify the high/low state level and the reference levels. If Rise time is selected in the Tool drop-down list, this subtree's label is Rise Range; otherwise, the label is Fall Range.

Syntax: trGUI.input.Treenode:=<value>

Example: trGUI.input.from:=20

Treenode Label Type Default Description
highVolt High State Level Input double <unassigned> Specify the high state level. If the Auto check box is checked, this value will be calculated by the specified method; otherwise, you can specify a value manually. If the Method is Largest Triangle, this variable is invisible in GUI and the value will be calculated automatically.
lowVolt Low State Level Input double <unassigned> Specify the low state level. If the Auto check box is checked, this value will be calculated by the specified method; otherwise, you can specify a value manually. If the Method is Largest Triangle, this variable is invisible in GUI and the value will be calculated automatically.
from From (%) of Step Height Input double 10 Specify a value n. Then the low reference level is at n% of the step height.
to To (%) of Step Height Input double 90 Specify a value m. Then the high reference level is at m% of the step height.

Quantities Subtree

Specify the quantities to output.

Syntax: trGUI.output.Treenode:=<value>

Example: trGUI.output.name:=0

Treenode Label Type Default Description
name Dataset Name(name) Input int 1 Specify whether to output the name of the source dataset. Options include:
  • 0:unchecked
Do not output the name of the source dataset.
  • 1:checked
Output the name of the source dataset.
VMin Low State Level(VMin) Input int 1 Specify whether to output the low state level. Options include:
  • 0:unchecked
Do not output the low state level.
  • 1:checked
Output the low state level.
VMax High State Level(VMax) Input int 1 Specify whether to output the high state level. Options include:
  • 0:unchecked
Do not output the high state level.
  • 1:checked
Output the high state level.
dV Step Height(dV) Input int 0 Specify whether to output the step height. Options include:
  • 0:unchecked
Do not output the step height.
  • 1:checked
Output the step height.
VrefMin Low Reference Level(VrefMin) Input int 1 Specify whether to output the low reference level. Options include:
  • 0:unchecked
Do not output the low reference level.
  • 1:checked
Output the low reference level.
VrefMax High Reference Level(VrefMax) Input int 1 Specify whether to output the high reference level. Options include:
  • 0:unchecked
Do not output the high reference level.
  • 1:checked
Output the high reference level.
dVref Rise Range(dVref)/Fall Range(dVref) Input int 0 Specify whether to output the rise range/fall range. If Rise Time is selected in the Tool drop-down list, the label is Rise Range(dVref); otherwise, the label is Fall Range(dVref). Options include:
  • 0:unchecked
Do not output the rise range/fall range.
  • 1:checked
Output the rise range/fall range.
T1 Time at Low Reference Level(T1) Input int 1 Specify whether to output the time at low reference level. Options include:
  • 0:unchecked
Do not output the time at low reference level.
  • 1:checked
Output the time at low reference level.
T2 Time at High Reference Level(T2) Inupt int 1 Specify whether to output the time at high reference level. Options include:
  • 0:unchecked
Do not output the time at high reference level.
  • 1:checked
Output the time at high reference level.
dT Rise Time(dT)/Fall Time(dT) Input int 1 Specify whether to output the rise time/fall time. If Rise Time is selected in the Tool drop-down list, the label is Rise Time(dT); otherwise, the label is Fall Time(dT). Options include:
  • 0:unchecked
Do not output the rise time/fall time.
  • 1:checked
Output the rise time/fall time.
Velocity Rise/Fall Velocity (Velocity) Input int 0 Specify whether to output the rise/fall velocity, which is computed by dVref/dT based on the smoothed data. Options include:
  • 0:unchecked
Do not output the rise/fall velocity.
  • 1:checked
Output the rise/fall velocity.
MaxVelocity Maximum Rise/Fall Velocity (MaxVelocity) Input int 0 Specify whether to output the rise/fall maximum velocity, which is maximum derivation value between T1 and T2. The maximum velocity is calculated based on the smoothed data. Options include:
  • 0:unchecked
Do not output the rise/fall maximum velocity.
  • 1:checked
Output the rise/fall maximum velocity.
e1 Noise Level Low(e1) Input int 0 Specify whether to output the noise level at low level baseline region. Options include:
  • 0:unchecked
Do not output the noise level at low level baseline region.
  • 1:checked
Output the noise level at low level baseline region.
e2 Noise Level High(e2) Input int 0 Specify whether to output the noise level at high level baseline region. Options include:
  • 0:unchecked
Do not output the noise level at high level baseline region.
  • 1:checked
Output the noise level at high level baseline region.

Output To Subtree

Specify where to output the results.

Syntax: trGUI.output_to.Treenode:=<value>

Example: trGUI.output_to.reslog:=1

Treenode Label Type Default Description
script Script Window Input int 1 Output the results to the Script Window. Options include:
  • 0:unchecked
Do not output the results to the Script Window.
  • 1:checked
Output the results to the Script Window.
reslog Results Log Input int 0 Output the results to the Results Log. Options include:
  • 0:unchecked
Do not output the results to the Results Log.
  • 1:checked
Output the results to the Results Log.
appendwks Append to Worksheet Input int 0 Append the output results to a worksheet. Options include:
  • 0:unchecked
Do not append the results to a worksheet.
  • 1:checked
Append the results to a worksheet.
wbkName Result Worksheet Name Input string QkRiseTime This is only available when the Append to Worksheet check box is selected. Use it to specify the name of worksheet to which the results are appended.

Display on Graph Subtree

Syntax: trGUI.display.Treenode:=<value>

Example: trGUI.display.risetime:=1

Treenode Label Type Default Description
indicator Indicator Input TreeNode <unassigned> Specify the settings for the indicator. See more details in the Indicator table below.
statelevel State Level Input int 1 Specify whether to show two horizontal lines for marking the low and high state level.
risetime Rise Time/Fall Time Input int 0 Specify whether to show two vertical lines through two indicators for marking the rise time/fall time. If Rise Time is selected in the Tool drop-down list, the label is Rise Time; otherwise, the label is Fall Time.
riserange Rise Range/Fall Range Input int 0 Specify whether to show two horizontal lines through two indicators for marking rise range/fall range. If Rise Time is selected in the Tool drop-down list, the label is Rise Range; otherwise, the label is Fall Range.

Indicator table

Syntax: trGUI.display.indicator.Treenode:=<value>

Example: trGUI.display.indicator.size:=11

Treenode Label Type Default Description
size Size Input int 10 Select the indicator size in points.
shape Symbol Input int 0 Select a symbol for the indicator. For more information about symbol, please refer to symbol tab of Plot Details.
edgecolor Edge Color Input int 0 Specify the edge color of the indicator which indicates the low/high reference level. For the choice of the color, see the list of colors.
fillcolor Fill Color Input int 1 Specify the color to fill the indicator which indicates the low/high reference level. For the choice of the color, see the list of colors.

Advanced Subtree

Advanced setting about smoothing before performing rise or fall time analysis.

Syntax: trGUI.adv.Treenode:=<value>

Example: trGUI.adv.pts:=60

Treenode Label Type Default Description
lnsearch Low/High Level Determine Input int 0 Only available when Method is set to Linear Search. Use it to specify how to find the low/high state level. Options include:
  • 0:Average
    Consider the average of adjacent average smoothed data as low/high state level. Please read the Linear Search methods in the Algorithm section below.
  • 1:Maximal Mean
    Consider the minimum/maximum of adjacent average smoothed data as low/high state level. Please read the Linear Search methods in the Algorithm section below.
pts Smooth Points Input int 50 Only available when Method is set to Linear Search. Use it to specify the number of points used in the smoothing that is performed to the whole dataset before the rise time/fall time analysis is executed. The value can be any integer between 1 and 200.
pts2 Smooth Points on Rising/Falling Area Input int 1 Specify the number of points used in the smoothing that is applied on the rising/falling area. The value can be any integer between 1 and 50.
tol Tolerance(Percentage) Input double 0.03 Specify the tolerance for level values. Any level below this will be treated as noises. Available when Method is set to Linear Search or Histogram.
bins Number of Bins Input int 256 Only available when Method is set to Histogram. Use it to specify the number of bins used in the histogram method.
onrescale When Graph Scale Changes Input int 0 Specify the operation that will perform when the graph scale changes. Options include:
  • Update Results
    When the graph scale changes, update the results.
  • Invalidate Results
    When the graph scale changes, invalidate the results. You will see a cross on the graph when the results are invalidated.
noiseUnit Noise Level Unit Input int 0 Specify the unit of noise level. Options include:
  • Absolute Value
    The noise level is an absolute value.
  • Relative to Step Size
    The noise level is relative to the step height.

Examples

The following steps is for calculating the rise time in a step-like signal in a graph.

  1. Create a new project and import the file <Origin Directory>\Samples\Signal Processing\Step Signal with Random Noise.dat.
    Addtool rise time 1.png
  2. Highlight column B and click the Line button on the 2D Graphs toolbar to create a graph.
  3. Click the Scale In button on the Tools bar, then zoom in the time range between 700 to 800 on the graph.
    Addtool rise time 2.png
  4. Select Gadgets: Rise Time... from the Origin menu (or run the script addtool_rise_time -d; in the command window) to open the dialog box of this X-Function.
  5. In the ROI Box tab, change the Color to green. Choose Rise Time with the Tool drop-down list, and then select Histogram with the Method drop-down list. Keep the default settings in the Rise Range tab and the Quantities tab as they are. In the Output To tab, make sure that only the Results Log check box is selected. In the Display on Graph tab and the Advanced tab, keep their default values.
    Addtool rise time 3.png
  6. Click the OK button. A green rectangle is added to the graph. Move the rectangle horizontally to make sure that the signal step is inside the rectangle. (Note: You may get different results if the rectangle is not exactly the same as shown in the screenshot below.)
    Addtool rise time 4.png
  7. Click the Arrow button.png button near the top-right corner of the rectangle to select New Output. The results should be output to the Results Log. (Note again that you may get different results if the rectangle is not exactly the same as shown in the screenshot above.)
    Addtool rise time 6.png

Algorithm

This function provides three methods for calculating rise/fall time. They are Linear Search and Histogram.

Linear Search

Take rise time calculation for example. The time that takes for a signal to rise from dTol1% of the step height to dTol2% of the step height (here, 0<dTol1<dTol2<100) should be computed.

Steps:

  1. Smoothing with the adjacent average method is appied to the raw data.
  2. Locate the high state level and the low state level. Two ways to find low/high state levels are provided. The first one is the high state level and the low state level are calculated by the means of the first 1% data points and the last 1% data points, respectively (In the Advanced branch of GUI, Set Low/High Level Determine as Average.). The second one is that after adjacent averaging, the minimum and maximum are considered as low and high state levels respectively (In the Advanced branch of GUI, Set Low/High Level Determine as Maximal Mean.).
  3. Linear search is performed to find two points, t1 and t2, from left to right such that:
    y(t1) > lowerbase + (upperbase-lowerbase)*dTol1\,
    y(t2) < lowerbase + (upperbase-lowerbase)*dTol2\,.
    here upperbase is the high state level while the lowerbase is the low state value.

Then the region between t1 and t2 is the rise area and risetime = t2 - t1\,.

Histogram

When this method is used, a state level histogram is created from the data. The limits of this histogram are set by the minimum and maximum values in the dataset and the number of bins is 256 by default. Then the number of data samples that fall into each bin is counted. The following picture is an example of the histogram. From this graph, the mean value of a bin ("Low" bin in the graph) with the maximum number of hits in the lower 40% bins is calculated as the low state level. Same calculation to a bin ("High" bin in the graph) in the upper 40% is used to calculate the high state level.

Addtool rise time 7.PNG

After locating the low state level and high state level by histogram, step 3 in the Linear Search method is used calculate the rise time or fall time.

Largest Triangle

As illustrated in the below picture, a line that passes through start point and end point is constructed. This line is called the base line. Then points which are on the upper-left of the base line are searched. If the triangle constructed by the point and the base line has the largest area, the vertical ordinate of this point will be regarded the value of the high state level. Similar search is performed to the points on the lower-right of the base line to find the value of the low state level.

Addtool rise time 8.png

After locating the low state level and high state level, step 3 in the Linear Search method is used to calculate the rise time or fall time.


Keywords:slope, ROI