Engee documentation

risetime

The rise time of the positive edge of two-level signals.

Library

EngeeDSP

Syntax

Function call

  • r = risetime(x) — returns a vector r, containing the time of each positive edge of the input two-level signal x from reference levels 10% before 90%. To determine the positive edges, the function risetime evaluates the state levels of the input signal using the histogram method. Function risetime defines 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 function risetime uses interpolation, r It 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 elements x. The first sampling moment x respond . Because the function risetime uses interpolation, r It may contain values that do not correspond to the sampling moments of the two-level signal. x.

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

  • r, lt, ut = risetime(_) — 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.

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

  • _ = 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

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

Details

The duration of the positive edge, returned as a vector. If the sampling rate is specified fs or sampling moments t,that rise time is specified in seconds. If the sampling frequency or sampling moments are not specified, the rise 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 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)

risetime 1

We will indicate the reference levels as a percentage PercentReferenceLevels:

risetime(cos.(t), t, PercentReferenceLevels=[30, 60])

risetime 2

We will also specify the tolerance for the state levels. Tolerance:

risetime(cos.(t), t, PercentReferenceLevels=[30, 60], Tolerance=10)

risetime 3

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)

risetime 4

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.

Literature

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