midcross
Midreference level crossing for bilevel waveform
Syntax
C = midcross(X)
C = midcross(X,FS)
C = midcross(X,T)
[C,MIDLEV]
= midcross(...)
C = midcross(X,Name,Value)
midcross(...)
Description
returns
a vector, C
= midcross(X
)C
, of time instants where each transition
of the input signal, X
, crosses the 50% reference
level. The sample instants correspond to the indices of the input
vector. Because midcross
uses interpolation to
determine the crossing instant, C
may contain
values that do not correspond to sampling instants. To determine the
transitions, midcross
estimates the state levels
of X
by a histogram method. midcross
identifies
all intervals which cross the upperstate boundary of the low state
and the lowerstate boundary of the high state. The lowstate and
highstate boundaries are expressed as the state level plus or minus
a multiple of the difference between the state levels. See StateLevel Tolerances.
specifies
the sample rate, C
= midcross(X
,FS
)FS
, in hertz as a positive scalar.
The first sample instant corresponds to t=0.
Because midcross
uses interpolation to determine
the crossing instant, C
may contain values that
do not correspond to sampling instants.
specifies the sample instants, C
= midcross(X
,T
)T
, as a vector
with the same number of elements as X
. Because midcross
uses
interpolation to determine the crossing instant, C
may
contain values that do not correspond to sampling instants.
[
returns the waveform value corresponding
to the midreference level. C
,MIDLEV
]
= midcross(...)
returns
the time instants corresponding to midreference level crossings with
additional options specified by one or more C
= midcross(X
,Name,Value
)Name,Value
pair
arguments.
midcross(...)
plots the signal and marks
the location of the midcrossings (midreference level instants) and
the associated reference levels. midcross
also
plots the state levels with upper and lower state boundaries.
Input Arguments

Bilevel waveform. 

Sample rate in hertz. 

Vector of sample instants. The length of 
NameValue Arguments
Specify optional
commaseparated pairs of Name,Value
arguments. Name
is
the argument name and Value
is the corresponding value.
Name
must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN
.

Midreference level as a percentage of the waveform amplitude. Default: 

Low and high state levels. 

Tolerance levels (lower and upperstate boundaries) expressed as a percentage. See StateLevel Tolerances. Default: 
Output Arguments

Time instants of the midreference level crossings. 

Midreference level. 
Examples
More About
References
[1] IEEE^{®} Standard on Transitions, Pulses, and Related Waveforms, IEEE Standard 181, 2003. p. 20.
See Also
falltime
 pulsewidth
 risetime
 settlingtime
 statelevels