risetime
The rise time of the positive edge of two-level signals.
| Library |
|
Syntax
Function call
-
r = risetime(x)— returns a vectorr, containing the time of each positive edge of the input two-level signalxfrom reference levels10%before90%. To determine the positive edges, the functionrisetimeevaluates the state levels of the input signal using the histogram method. Functionrisetimedefines all areas that intersect the upper boundary of the low level and the lower boundary of the high level. The boundaries of the low and high levels are expressed as the state level plus or minus a multiple of the difference between the levels. See State level tolerances. Because the functionrisetimeuses interpolation,rIt may contain values that do not correspond to the sampling moments of the two-level signal.x.
-
r = risetime(x, fs)— uses the sampling frequency in Hz. The sampling frequency determines the sampling moments corresponding to the elementsx. The first sampling momentxrespond . Because the functionrisetimeuses interpolation,rIt may contain values that do not correspond to the sampling moments of the two-level signal.x.
-
_ = risetime(_, Name=Value)— returns the rise time with additional parameters specified by one or more arguments Name=Value.
-
risetime(_)— plots the signal and darkens the areas of each edge where the rise time is calculated. The chart shows the lower and upper intersections and the corresponding reference levels. The state levels and their corresponding lower and upper state boundaries are also displayed.
Arguments
Input arguments
# fs — sampling frequency, Hz
+
scalar
Details
The sampling frequency in Hz, set as a positive real scalar.
Name-value input arguments
Specify optional argument pairs in the format Name=Value, where Name — the name of the argument, and Value — the appropriate value. Type arguments Name=Value they should be placed after the other arguments, but the order of the pairs does not matter.
# PercentReferenceLevels — reference levels as a percentage of the signal amplitude
+
[10 90] (by default) | A two-element vector is a string
Details
Reference levels as a percentage of the signal amplitude, set as a two-element positive vector string. The elements of the row vector correspond to the lower and upper reference levels as a percentage. A high state level is defined as 100%, and low is like 0%. For more information, see [percentage-reference-levels].
# StateLevels — low and high state levels
+
A two-element vector is a string
Details
Low and high state levels, specified as a two-element vector string. The first and second elements of the vector correspond to low and high levels of states.
# Tolerance — upper and lower bounds of the state levels
+
2 (by default) | scalar
Details
The upper and lower bounds of the state levels, defined as a real positive scalar. For more information, see State level tolerances.
# out — type of output data
+
:plot (by default) | :data
Details
Type of output data:
-
:plot— the function returns a graph; -
:data— the function returns data.
Output arguments
# r is the duration of the positive edge
+
vector
# lt — points of intersection of the lower reference level
+
vector
Details
The points of intersection of the lower reference level, returned as a vector. Vector lt It contains the time points when the positive edge crosses the lower reference level. By default, the lower value of the reference level is 10% from the reference level. You can change the default reference levels by specifying PercentReferenceLevels.
# ut — points of intersection of the upper reference level
+
vector
Details
The points of intersection of the upper reference level, returned as a vector. Vector ut It contains the time points when the positive edge crosses the upper reference level. By default, the upper value of the reference level is 90% from the reference level. You can change the default reference levels by specifying PercentReferenceLevels.
# ll — lower reference level
+
scalar
Details
The lower reference level in units of the signal amplitude, returned as a real numeric scalar.
By default, the lower value of the reference level is 10% from the reference level. You can change the default reference levels by specifying PercentReferenceLevels.
# ul — upper reference level
+
scalar
Details
The upper reference level in units of the signal amplitude, returned as a real numeric scalar.
By default, the upper value of the reference level is 90% from the reference level. You can change the default reference levels by specifying PercentReferenceLevels.
Examples
Rise time of the sinusoidal signal
Details
Calculate the rise time of the sinusoidal signal.
import EngeeDSP.Functions: risetime
t = 0:pi/5:4*pi
risetime(cos.(t), t)

We will indicate the reference levels as a percentage PercentReferenceLevels:
risetime(cos.(t), t, PercentReferenceLevels=[30, 60])

We will also specify the tolerance for the state levels. Tolerance:
risetime(cos.(t), t, PercentReferenceLevels=[30, 60], Tolerance=10)

We will also indicate the low and high levels of states. StateLevels:
risetime(cos.(t), t, PercentReferenceLevels=[30, 60], StateLevels=[0, 0.6], Tolerance=10)

Additional Info
A positive front
Details
A positive edge in a two—level signal is a transition from a low-level state to a high-level state. The pulse of positive polarity (increasing) has an end state higher than the initial one. If the signal is differentiable in the vicinity of the front, the equivalent definition is a front with a positive first derivative.
Percentage reference levels
Details
If — this is a low state, — high condition, eh — the upper percentage reference level, then the signal value corresponding to the upper percentage reference level is:
If — this is the lower percentage reference level, then the signal value corresponding to the lower percentage reference level is:
State level tolerances
Details
You can specify the lower and upper bounds of the states for each state level. Define boundaries as the state level plus or minus a scalar value that is a multiple of the difference between high and low states. To set a useful tolerance range, specify a scalar as a small number, for example, 2/100 or 3/100. In the general case, the area for a low state, it is defined as:
where — low condition, — high condition. Replace the first term in the equation with to get the tolerance area for a high condition.