State-level estimation for bilevel waveform with histogram method

estimates the low and high state levels in the bilevel waveform
`levels`

= statelevels(`x`

)`x`

using the histogram method. For more information, see
Algorithms.

`statelevels(___)`

displays a plot of the
signal and the corresponding histogram.

`statelevels`

uses the histogram method to estimate the states of a bilevel
waveform. The histogram method is described in [1]. The steps of this
method are:

Determine the maximum and minimum amplitudes and amplitude range of the data.

For the specified number of histogram bins, determine the bin width, which is the ratio of the amplitude range to the number of bins.

Sort the data values into the histogram bins.

Identify the lowest-indexed histogram bin, $${i}_{\text{low}}$$, and highest-indexed histogram bin,

*i*, with nonzero counts._{high}Divide the histogram into two subhistograms:

The indices of the lower histogram bins are $${i}_{\text{low}}\le i\le {\scriptscriptstyle \frac{1}{2}}({i}_{\text{high}}-{i}_{\text{low}})$$.

The indices of the upper histogram bins are $${i}_{\text{low}}+{\scriptscriptstyle \frac{1}{2}}({i}_{\text{high}}-{i}_{\text{low}})\le i\le {i}_{\text{high}}$$.

Compute the state levels by determining the mode or mean of the lower and upper histograms.

[1] *IEEE ^{®} Standard on Transitions,
Pulses, and Related Waveforms*, IEEE Standard 181, 2003,
pp. 15–17.

`midcross`

| `overshoot`

| `risetime`

| `undershoot`