Settling time for bilevel waveform
returns the time from the mid-reference level instant to the time instant each
transition enters and remains within a 2% tolerance region of the final state over
s = settlingtime(
d. To determine the transitions, the
settlingtime function estimates the state levels of the
input waveform by a histogram method and identifies all regions that cross the
upper-state boundary of the low state and the lower-state boundary of the high state.
If for any transition, the level of the waveform does not remain within
the lower and upper tolerance boundaries, the requested duration is not
present, or an intervening transition is detected,
settlingtime marks the corresponding element in
NaN. For cases in which
settlingtime returns a
Settle Seek Duration.
returns the settling times, levels, and corresponding sample instants with
additional options specified by one or more name-value arguments. You can specify an
input combination from any of the previous syntaxes.
settlingtime(___) plots the signal and darkens
the regions of each transition where settling time is computed. The plot marks the
location of the settling time of each transition, the mid-crossings, and the
associated reference levels. The plot also displays the state levels with the
corresponding lower and upper tolerance boundaries.
Determine Settling Point and Settling Level
Determine the settling point and corresponding waveform value for a bilevel waveform. Specify a settle-seek duration of 10 seconds.
load('transitionex.mat', 'x') [s,slev,sinst] = settlingtime(x,10);
Plot the waveform and annotate the settling point.
ans = 1.8901
Determine Settling Points of Three-Transition Bilevel Waveform
Determine the settling points for a three-transition bilevel waveform. The data are sampled at 4 MHz. Specify a settle-seek duration of one microsecond.
load('transitionex.mat','x') y = [x; fliplr(x)]; fs = 4e6; t = 0:1/fs:(length(y)*1/fs)-1/fs; [s,slev,sinst] = settlingtime(y,fs,1e-6);
Plot the waveform and annotate the settling points.
ans = 3×1 10-6 × 0.4725 0.1181 0.4725
x — Bilevel waveform
Bilevel waveform, specified as a real-valued vector. The first sample
x is equal to t=0.
d — Settle-seek duration
Settle-seek duration in seconds, specified as a positive scalar. This
argument defines the duration after the mid-reference level instant that
settlingtime looks for a settling time. If no
settling time occurs in
d seconds after the
mid-reference level instant, the function returns a
For more information, see Settling Time and Settle Seek Duration.
Fs — Sample rate
positive real scalar
Sample rate, specified as a positive real scalar in hertz.
t — Sample instants
Sample instants, specified as a vector. The length of
t must equal the length of the input bilevel
Specify optional pairs of arguments as
the argument name and
Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
s = settlingtime(x,Fs,Tolerance=5)
Before R2021a, use commas to separate each name and value, and enclose
Name in quotes.
s = settlingtime(x,Fs,'Tolerance',5)
MidPercentReferenceLevel — Mid-reference level
50 (default) | scalar
Mid-reference level as a percentage of the waveform amplitude, specified as a scalar. For more information, see Mid-Reference Level.
StateLevels — Low- and high-state levels
1-by-2 real-valued vector
Low- and high-state levels, specified as a 1-by-2 real-valued vector.
The first element is the low-state level and the second element is the
high-state level. If you do not specify
'StateLevels', the function estimates the state
levels from the input waveform using the histogram method.
Tolerance — Tolerance levels
2 (default) | scalar
Tolerance levels (lower and upper state boundaries), specified as a scalar and expressed as a percentage. The low-state and high-state boundaries 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.
s — Settling time
Settling time, returned as a vector. The settling time corresponds to the
time from the mid-reference level instant to the time instant each
transition enters and remains within a 2% tolerance region of the final
state over duration
d. The length of
s is equal to the number of detected transitions in
the input bilevel waveform
settlingtime uses interpolation to
determine the mid-reference level instant,
may contain values that do not correspond to sampling
slev — Waveform values at settling points
Waveform values at the settling points, returned as a vector.
sinst — Time instants of settling points
Time instants of the settling points, returned as a vector.
The settling time is the time after the mid-reference level instant when the signal crosses into and remains in the 2%-tolerance region around the state level. The settling time is illustrated in this figure, where the low- and high-state levels are the dashed black lines, the 2% tolerances above and below the state levels are shown by the red dashed lines, and the settling time is indicated by the yellow circle.
The mid-reference level in a bilevel waveform with low-state level S_1 and high- state level S_2 is
Mid-Reference Level Instant
Let y50% denote the mid reference level.
Let t50%- and t50%+ denote the two consecutive sampling instants corresponding to the waveform values nearest in value to y50%.
Let y50%- and y50%+ denote the waveform values at t50%- and t50%+.
The mid-reference level instant is
You can specify lower- and upper-state boundaries for each state level. Define the boundaries as the state level plus or minus a scalar multiple of the difference between the high state and the low state. To provide a useful tolerance region, specify the scalar as a small number such as 2/100 or 3/100. In general, the region for the low state is defined as
where is the low-state level and is the high-state level. Replace the first term in the equation with to obtain the tolerance region for the high state.
This figure shows lower and upper 5% state boundaries (tolerance regions) for a positive-polarity bilevel waveform. The thick dashed lines indicate the estimated state levels.
Settle Seek Duration
The settle seek duration defines the interval of time after the mid-reference
level instant that
settlingtime looks for a settling point. If
settlingtime does not find a settling point within the
settle seek duration,
NaN for the settling time. This figure illustrates a settle
seek duration of 10 samples.
settlingtime function may fail to find a settling point in the
specified settle seek duration if any one of these conditions occurs:
The last waveform value in the settle seek interval is not within the upper- and lower-state boundaries determined by the specified tolerance. This figure illustrates this condition for a settle seek duration of 8 samples and a 2% tolerance region. The last sample in the settle seek interval exceeds the upper state boundary. In this example, reducing or increasing the settle seek duration can result in a valid settling time.
There is an insufficient number of waveform samples for the specified settle seek duration. This figure illustrates this condition for a settle seek duration of 20 samples. The settle seek duration extends beyond the final sample of the waveform.
An intervening transition is detected before the end of the specified settle seek duration. This figure illustrates this condition for a settle seek duration of 22 samples. An intervening transition is detected before the end of the 22–sample settle seek duration.
 IEEE® Standard on Transitions, Pulses, and Related Waveforms, IEEE Standard 181, 2003, pp. 23–24.
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Introduced in R2012a