State-level estimation for bilevel rectangular waveform
StateLevels object estimates the state
levels of a bilevel rectangular waveform.
To estimate the state levels of a bilevel waveform:
Define and set up your state-level estimation. See Construction.
step to estimate the state levels
for an input vector according to the properties of
The behavior of
step is specific to each object in
Starting in R2016b, instead of using the
H = dsp.StateLevels creates
a state-level estimation System object,
estimates state levels in a bilevel rectangular waveform using the
histogram method with 100 bins.
H = dsp.StateLevels(' returns
StateLevels System object,
with each specified property set to the specified value.
Minimum and maximum levels of the histogram. Specify the range
of the histogram as a 2-element real–valued row vector. Signal
values outside the range defined by this property are ignored. This
property applies when you set the
Source of histogram bounds. Specify how to determine the histogram
bounds as one of
Number of bins in the histogram. Specify the number of bins
in the histogram. This property applies when you set the
Enable histogram output. Set this property to
Algorithm used to compute state levels. Specify the method used
to compute state levels as one of
Calculation over successive calls to
A particular level, which can be associated with an upper and lower state boundary. States are ordered from the most negative to the most positive. In a bilevel waveform, the most negative state is the low state. The most positive state is the high state.
Each state level can have associated lower- and upper-state boundaries. These state boundaries are defined as the state level plus or minus a scalar multiple of the difference between the high state and low state. To provide a useful tolerance region, the scalar is typically a small number such as 2/100 or 3/100. In general, the α% tolerance region for the low state is defined as
where S1 is the low-state level and S2 is the high-state level. Replace the first term in the equation with S2 to obtain the α% tolerance region for the high state.
The following figure illustrates lower and upper 2% state boundaries (tolerance regions) for a positive-polarity bilevel waveform. The estimated state levels are indicated by a dashed red line.
|clone||Clones the current instance of the state levels object|
|getNumInputs||Number of expected inputs to the |
|getNumOutputs||Number of outputs of the |
|isLocked||Locked status (logical) for input attributes and nontunable properties|
|plot||Plot signal, state levels, and histogram|
|release||Allow property value and input characteristics changes|
|reset||Reset internal states of state levels object|
|step||Estimate state levels for bilevel rectangular waveform|
Compute and plot the state levels of a 2.3 V underdamped noisy clock. Load the clock data in the variable,
x, and the sampling instants in the variable
Note: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the function with the equivalent
step syntax. For example, myObject(x) becomes step(myObject,x).
load('clockex.mat', 'x', 't');
Estimate the state levels.
h = dsp.StateLevels; levels = h(x);
Plot the clock data along with the estimated state levels and histograms.
StateLevels System object uses the
histogram method to estimate the states of a bilevel waveform. The
histogram method is described in .
To summarize the method:
Determine the maximum and minimum amplitudes and amplitude range of the data.
For the specified number of histogram bins, determine the bin width as 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, ilow, and highest-indexed histogram bin, ihigh, with nonzero counts.
Divide the histogram into two subhistograms. The lower-histogram bins are ilow ≤ i ≤ 1/2(ihigh — ilow).
The upper-histogram bins are ilow + 1/2(ihigh – ilow) ≤ i ≤ ihigh.
Compute the state levels by determining the mode or mean of the lower and upper histograms.
 IEEE® Standard on Transitions, Pulses, and Related Waveforms, IEEE Standard 181, 2003, pp. 15–17.