Rise time of positive-going bilevel waveform transitions
returns a vector,
r = risetime(
r, containing the time each transition of
the input bilevel waveform,
x, takes to cross from the 10%
to 90% reference levels. To determine the transitions,
risetime estimates the state levels of the input
waveform by a histogram method.
risetime identifies all
regions that cross the upper-state boundary of the low state and the lower-state
boundary of the high state. 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. See State-Level Tolerances. Because
risetime uses interpolation,
contain values that do not correspond to sampling instants of the bilevel
specifies the sample rate in hertz. The sample rate determines the sample
instants corresponding to the elements in
r = risetime(
x. The first
sample instant in
x corresponds to t = 0. Because
risetime uses interpolation,
r can contain values that do not correspond to sampling
instants of the bilevel waveform,
[___] = risetime(___,
returns the rise times with additional options specified by one or more
risetime(___) plots the signal and darkens
the regions of each transition where rise time is computed. The plot marks the
lower and upper crossings and the associated reference levels. The state levels
and the corresponding associated lower- and upper-state boundaries are also
Rise Time in Bilevel Waveform
Determine the rise time in samples for a 2.3 V clock waveform.
Load the 2.3 V clock data. Determine the rise time in samples. Use the default 10% and 90% percent reference levels.
load("transitionex.mat","x","t") R = risetime(x)
R = 0.7120
The rise time is less than 1, indicating that the transition occurred in a fraction of a sample. Plot the data, including the time information, and annotate the rise time.
Rise Time, Reference-Level Instants, and Reference Levels
Determine the rise time, reference-level instants, and reference levels in a 2.3 V clock waveform sampled at 4 MHz.
Load the 2.3 V clock waveform along with the sampling instants.
Determine the rise time, reference-level instants, and reference levels.
[R,lt,ut,ll,ul] = risetime(x,t);
Plot the waveform with the lower- and upper-reference levels and reference-level instants. Show that the rise time is the difference between the upper- and lower-reference level instants.
plot(t,x) xlabel("Seconds") ylabel("Volts") hold on plot([lt ut],[ll ul],"o") hold off
fprintf('Rise time is %g seconds.',ut-lt)
Rise time is 1.78e-07 seconds.
Align Two Bilevel Waveforms
Generate two signals that represent bilevel waveforms. The signals are sampled at 50 Hz for 20 seconds. For the first signal, the transition occurs 13 seconds after the start of the measurement. For the second signal, the transition occurs 5 seconds after the start of the measurement. The signals have different amplitudes and are embedded in white Gaussian noise of different variances. Plot the signals.
tt = linspace(0,20,1001)'; e1 = 1.4*tanh(tt-13)+randn(size(tt))/3; e2 = tanh(3*(tt-5))+randn(size(tt))/5; plot(tt,e1,tt,e2)
Align the signals so their transition times coincide. Correlation-based methods cannot align this type of signals adequately.
[y1,y2,D] = alignsignals(e1,e2); plot(y1) hold on plot(y2) hold off
risetime to align the signals. For each signal, find the transition time as the average of the instant at which the signal crosses the lower reference level and the instant at which it crosses the upper reference level. Plot the aligned waveforms.
[~,l1,u1] = risetime(e1,tt); [~,l2,u2] = risetime(e2,tt); t1 = tt-(l1+u1)/2; t2 = tt-(l2+u2)/2; plot(t1,e1,t2,e2)
Rise Time with Nondefault Reference Levels
Determine the rise time in a 2.3 V clock waveform sampled at 4 MHz. Compute the rise time using the 20% and 80% reference levels.
Load the 2.3 V clock data with sampling instants. Compute the sample rate as the inverse of the time difference between consecutive samples. Determine the rise time using the 20% and 80% reference levels. Plot the annotated waveform.
load("transitionex.mat","x","t") fs = 1/(t(2)-t(1)); risetime(x,fs,PercentReferenceLevels=[20 80])
ans = 1.3350e-07
x — Bilevel waveform
Bilevel waveform, specified as a real-valued vector.
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 bilevel waveform
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.
50] specifies that the low and high levels are 0 ± 10% and 0.8 ± 10%, respectively, and that a transition occurs when the signal
crosses from 0.8 × 0.2 to 0.8 × 0.5.
Before R2021a, use commas to separate each name and value, and enclose
Name in quotes.
PercentReferenceLevels — Reference levels as a percentage of the waveform amplitude
[10 90] (default) | two-element positive row vector
Reference levels as a percentage of the waveform amplitude, specified as a two-element positive row vector. The elements of the row vector correspond to the lower and upper percent reference levels. The high state level is defined to be 100 percent and the low state level is defined to be 0 percent. See Percent Reference Levels for more details.
StateLevels — Low and high state levels
two-element row vector
Low and high state levels, specified as a two-element row vector. The first and second elements of the vector correspond to the low and high state levels.
Tolerance — Lower- and upper-state boundaries
2 (default) | real positive scalar
Lower- and upper-state boundaries, specified as a real positive scalar as a percentage value. For more information, see State-Level Tolerances.
r — Duration of positive-going transition
Duration of positive-going transition, returned as a vector. If you
specify the sample rate
Fs or the sample instants
t, the rise times are in seconds. If you do not
specify a sample rate or sample instants, the rise times are in
lt — Lower reference-level crossing instants
Lower reference-level crossing instants, returned as a vector. The vector
lt contains the time instants when the
positive-going transition crosses the lower reference level. By default, the
lower reference level is the 10% reference level. You can change the default
reference levels by specifying
ut — Upper reference-level crossing instants
Upper reference-level crossing instants, returned as a vector. The vector
ut contains the time instants when the
positive-going transition crosses the upper reference level. By default, the
upper reference level is the 90% reference level. You can change the default
reference levels by specifying
ll — Lower reference level
real numeric scalar
Lower reference level in waveform amplitude units, returned as a real
ll is a vector containing the waveform
values corresponding to the lower reference level in each positive-going
transition. By default, the lower reference-level is the 10% reference
level. You can change the default reference-levels by specifying
ul — Upper reference level
real numeric scalar
Upper reference level in waveform amplitude units, returned as a real
ul is a vector containing the waveform
values corresponding to the upper reference level in each positive-going
transition. By default, the upper reference level is the 90% reference
level. You can change the default reference levels by specifying
A positive-going transition in a bilevel waveform is a transition from the low-state level to the high-state level. A positive-polarity (positive-going) pulse has a terminating state more positive than the originating state. If the waveform is differentiable in the neighborhood of the transition, an equivalent definition is a transition with a positive first derivative. This figure shows a positive-going transition.
The amplitude values of the waveform do not appear because a positive-going transition does not depend on the actual waveform values. A positive-going transition is defined by the direction of the transition.
Percent Reference Levels
If S1 is the low state, S2 is the high state, and U is the upper-percent reference level, the waveform value corresponding to the upper percent reference level is
If L is the lower-percent reference level, the waveform value corresponding to the lower percent reference level 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.
 IEEE® Standard on Transitions, Pulses, and Related Waveforms, IEEE Standard 181, 2003, pp. 15–17.
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Introduced in R2012a