Engee documentation

settlingtime

The time of setting two-level signals.

Library

EngeeDSP

Syntax

Function call

  • s = settlingtime(x, d) — returns the time from the moment of the average reference level to the moment at which each transition occurs and remains within 2%-the tolerance range from the final state over time d. To determine the transitions, the function settlingtime evaluates the state levels of the input signal using the histogram method and identifies all areas crossing the upper boundary of the low state and the lower boundary of the high state.

    If the signal level for any transition exceeds the lower and upper tolerance limits, the requested duration is missing, or an intermediate transition is detected, then the function settlingtime marks the corresponding element in s how NaN. Cases where settlingtime returns NaN, see Duration of the establishment search.
  • s = settlingtime(x, Fs,d) — uses the sampling rate Fs.

  • s = settlingtime(x, t,d) — uses sampling moments t.

  • s, slev, sinst = settlingtime(_) — returns levels slev and the moments of time sinst establishment points for each transition.

  • _ = settlingtime(_, Name,Value) — returns the installation time s, levels slev and the corresponding points in time sinst with additional parameters specified by one or more arguments of the type Name,Value. You can specify an input combination from any of the above syntax options.

Arguments

Input arguments

# x is a two— level signal

+ vector

Details

A two-level signal defined as a real vector. The first countdown on the axis equal to .

# d — the duration of the establishment search, with

+ positive scalar

Details

The duration of the search is set in seconds, set as a positive scalar. This argument defines the length of the period after the moment of the average reference level during which the function settlingtime looking for the time of establishment. If during the d seconds after the moment of the average reference level, the setting time does not occur, then the function returns NaN. For more information, see Time of establishment and Duration of the establishment search.

# Fs — sampling frequency, Hz

+ scalar

Details

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

# t — sampling moments

+ vector

Details

Sampling moments specified as a 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: settlingtime([4,3,2,1,1,1], 2, "MidPercentReferenceLevel", 30).

# MidPercentReferenceLevels — average reference level as a percentage

+ 50 (by default) | scalar

Details

The average reference level as a percentage of the signal amplitude, set as a scalar. For more information, see The average reference level.

# 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. If the parameter StateLevels If not specified, the function evaluates the state levels based on the input signal using the histogram method.

# Tolerance — tolerance levels

+ 2 (by default) | scalar

Details

Tolerance levels (upper and lower bounds of the state levels), set as a scalar and expressed as a percentage. The boundaries of the lower and upper states are expressed as the state level plus or minus a multiple of the difference between the state levels. For more information, see State level tolerances.

# out — type of output data

+ :data (by default) | :plot

Details

The type of output data. To use this argument, use the following syntax:

  • out=:plot — the function returns a graph;

  • out=:data — the function returns data.

Examples:

import EngeeDSP.Functions: settlingtime

settlingtime([4,3,2,1,1,1], 2,"MidPercentReferenceLevel", 30, out=:data)
(0.5544000000000002, 1.0545999999999998, 3.9454000000000002)
import EngeeDSP.Functions: settlingtime

settlingtime([4,3,2,1,1,1], 2,"MidPercentReferenceLevel", 30, out=:plot)

settlingtime 1

Output arguments

# s — installation time

+ vector

Details

The setup time returned as a vector. The establishment time corresponds to the time from the moment of the average reference level to the moment when each transition enters the tolerance area 2% from the final state during d. Vector length s is equal to the number of detected transitions in the input two-level signal x.

Because settlingtime uses interpolation to determine the moment of the average reference level, s it may contain values that do not correspond to the moments of the samples.

# slev — signal values at the points of establishment

+ vector

Details

The signal values at the establishment points, returned as a vector.

# sinst — time points at the establishment points
vector

Details

The time points at the establishment points, returned as a vector.

Additional Info

Time of establishment

Details

The establishment time is the time after the average reference level is reached, when the signal passes into the range 2% the tolerance is relative to the state level and remains in it. The time of establishment is shown in this figure, where the levels of low and high states are indicated by black dashed lines., 2% The tolerances above and below the condition levels are indicated by red dashed lines, and the establishment point is indicated by a yellow circle.

settlingtime 2 en

The average reference level

Details

The average reference level in a two-level low-level waveform and a high level equal to

The moment of the average reference level

Details

The moment of the average reference level:

where

  • — average reference level;

  • and — two consecutive sampling moments corresponding to the signal values closest to ;

  • and — signal values at moments and .

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.

Duration of the establishment search

Details

The duration of the establishment search determines the time interval after the moment of the average reference level during which the function settlingtime It is looking for a point of establishment. If settlingtime does not find the establishment point during the duration of the establishment search, then settlingtime returns NaN for the time of establishment. This figure illustrates the duration of the establishment search, equal to 10 counting down.

settlingtime 4 en

Function settlingtime It may fail to find the establishment point within the specified search duration if any of the following conditions occur.

  • The last value of the signal in the establishment search interval is not within the upper and lower boundaries of the states determined by the specified tolerance. This figure shows this state for the duration of the establishment search, equal to 8 counts, and tolerance areas 2%. The last count in the establishment search interval exceeds the upper limit of the states. In this example, reducing or increasing the duration of the setup search may result in the correct setup time.

    settlingtime 3 en

  • Insufficient number of signal samples for the specified search duration. This figure shows this state for the duration of the search in 20 counts. The duration of the search is beyond the last signal count.

    settlingtime 5 en

  • An intermediate transition is detected before the end of the specified search duration. This figure shows this state for a search duration equal to 22 counting down. An intermediate transition is detected before the end of the search duration, which is equal to 22 counting down.

    settlingtime 6 en

Literature

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