Engee documentation

falltime

The decay time of the negative edges of two-level signals.

Library

EngeeDSP

Syntax

Function call

  • f = falltime(x) — returns a vector f, containing the time of each negative edge of the input two-level signal x from reference levels 90% before 10%. Because the function falltime uses interpolation, f It may contain values that do not correspond to the sampling moments of the two-level signal. x.

  • f = falltime(x, fs) — uses the sampling frequency in Hz. The sampling frequency determines the sampling moments corresponding to the elements x.

  • f = falltime(x, t) — uses sampling moments t, which are defined as a vector with the same number of elements as x.

  • f, lt, ut = falltime(_) — returns vectors lt and ut, the elements of which correspond to the points in time when x crosses the lower and upper percentage reference levels. This output syntax can be used with any of the previous input syntaxes.

  • f, lt, ut, ll, ul = falltime(_) — also returns levels ll and ul, corresponding to the lower and upper percentage reference levels.

  • _ = falltime(_, Name,Value) — returns the fall-off time with additional parameters specified by one or more arguments of the type Name,Value.

Arguments

Input arguments

# x is a two— level signal

+ vector

Details

A two-level signal defined as a real vector.

# fs — sampling frequency, Hz

+ scalar

Details

The sampling frequency in Hz, set as a positive real scalar.

# t — sampling moments

+ vector

Details

The sampling moments specified as a real vector. Length t must be equal to the length of the two-level signal x.

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

Details

The duration of the negative edge, returned as a vector. If the sampling rate is specified fs or sampling moments t, the drop time is given in seconds. If the sampling frequency or sampling moments are not specified, then the decay time is indicated in the samples.

# 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)

falltime 1

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.

Literature

  1. IEEE® Standard on Transitions, Pulses, and Related Waveforms, IEEE Standard 181, 2003, pp. 15–17.