levels = statelevels (A) ¶levels = statelevels (A, nbins) ¶levels = statelevels (A, nbins, method) ¶levels = statelevels (A, nbins, method, bounds) ¶[levels, histograms] = statelevels (…) ¶[levels, histograms, binlevels] = statelevels (…) ¶(…) ¶Estimate state-level for bilevel waveform A using histogram method
INPUTS:
Bylevel waveform
Number of histogram bins (100 default)
State-level estimation method ’mode’ (default) or ’mean’.
2 element vector for histogram lower and upper bounds. Values outside of this will be ignored.
OUTPUTS:
Levels of high and low states
Histogram counts
Histogram bincenters
If no outputs are provided, the signal and histogram will be plotted, and display the levels.
The following code
# Generate test signal t = linspace(0,2*pi*10,100); X = square(t) + cos(t); # plot the waveform and provide the levels statelevels(X)
Produces the following output
ans = -1.9795 1.9800
and the following figure
| Figure 1 |
|---|
![]() |
Package: signal