falltime
The decay time of the negative edges of two-level signals.
| Library |
|
Syntax
Function call
-
_ = falltime(_, Name,Value)— returns the fall-off time with additional parameters specified by one or more arguments of the typeName,Value.
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. Name-value arguments should be placed after other arguments, but the order of the pairs does not matter.
Use commas to separate the name and value, and Name put it in quotation marks.
Example: f = falltime([4,3,2,1], "PercentReferenceLevels", [30 60]).
# 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 low and high reference levels as a percentage. A high state level is defined as 100%, and the low one 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
+
:data (default) | :plot
Details
Type of output data:
-
:data— the function returns data; -
:plot— the function returns a graph.
Output arguments
# f — duration of the negative 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 negative 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 values of the reference levels by specifying the argument 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 negative 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 values of the reference levels by specifying the argument 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 values of the reference levels by specifying the argument 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 values of the reference levels by specifying the argument PercentReferenceLevels.
Examples
Signal decay time
Details
Calculate the signal decay time.
import EngeeDSP.Functions: falltime
f = falltime([4,3,2,1], "PercentReferenceLevels", [30 60], out=:data)
(0.5940000000000003, 3.391, 2.7969999999999997, 1.609, 2.2030000000000003)
Let’s print a graph.
import EngeeDSP.Functions: falltime
f = falltime([4,3,2,1], "PercentReferenceLevels", [30 60], out=:plot)

Additional Info
The front of the signal
Details
To determine the front, the function falltime evaluates the state levels of the input signal using the histogram method. The function defines all regions that intersect the lower boundary of the high state and the upper boundary of the low state. The boundaries of low and high states are expressed as the state level plus or minus a multiple of the difference between the state levels.
The negative front
Details
The negative edge in a two—level signal is the transition from a high-level state to a low-level state. If the signal is differentiable in the vicinity of the front, the equivalent definition is a front with a negative 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.