Main Content

BilevelMeasurementsConfiguration

Measure transitions, aberrations, and cycles of bilevel signals

    Description

    Use the BilevelMeasurementsConfiguration object to measure transitions, aberrations, and cycles of bilevel signals. You can also specify the bilevel settings such as high-state level, low-state level, state-level tolerance, upper-reference level, mid-reference level, and lower-reference level.

    You can control bilevel measurements from the toolstrip or from the command line. To modify bilevel measurements from the scope interface, click the Measurements tab and enable the settings in the Bilevel section. A panel appears at the bottom of the Time Scope window showing all the measurements you enabled.

    Time Scope window with bilevel measurements highlighted. Also shows Transitions panel.

    Aberrations panel

    Cycles panel

    Creation

    Description

    example

    bilevelMeas = BilevelMeasurementsConfiguration() creates a bilevel measurements configuration object.

    Properties

    expand all

    All properties are tunable.

    Automatic detection of high- and low-state levels, specified as true or false. Set this property to true so that the scope automatically detects high- and low-state levels in the bilevel waveform. When you set this property to false, you can specify values for the high- and low- state levels manually using the HighStateLevel and LowStateLevel properties.

    Scope Window Use

    Click the Measurements tab on the Time Scope toolstrip. In the Bilevel section, click Bilevel Settings and select the Auto State Level check box.

    Data Types: logical

    High-state level, specified as a nonnegative scalar. The high-state level denotes a positive polarity.

    If the initial transition of a pulse is positive-going, the pulse has positive polarity. The terminating state of a positive-polarity (positive-going) pulse is more positive than the originating state.

    This figure shows a positive-polarity pulse.

    Dependency

    To enable this property, set AutoStateLevel to false.

    Scope Window Use

    Click the Measurements tab on the Time Scope toolstrip. In the Bilevel section, click Bilevel Settings, clear the Auto State Level check box, and specify High to a nonnegative scalar.

    Data Types: double

    High-state level, specified as a nonnegative scalar. The low-state level denotes a negative polarity.

    If the initial transition of a pulse is negative-going, the pulse has negative polarity. The terminating state of a negative-polarity (negative-going) pulse is more negative than the originating state.

    This figure shows a negative-polarity pulse.

    Dependency

    To enable this property, set AutoStateLevel to false.

    Scope Window Use

    Click the Measurements tab on the Time Scope toolstrip. In the Bilevel section, click Bilevel Settings, clear the Auto State Level check box, and specify Low to a nonnegative scalar.

    Data Types: double

    Tolerance level of the state, specified as a positive scalar in the range (0 100).

    This value determines how much a signal can deviate from the low- or high-state level before it is considered to be outside that state. Specify this value as a percentage of the difference between the high- and low-state levels. For more details, see State-Level Tolerances.

    Scope Window Use

    Click the Measurements tab on the Time Scope toolstrip. In the Bilevel section, click Bilevel Settings, and specify the State Level Tol. (%) to a positive scalar less than 100.

    Data Types: double

    Upper-reference level, specified as a positive scalar in the range (0 100). The scope uses the upper-reference level to compute the start of a fall time or the end of a rise time. Specify this value as a percentage of the difference between the high- and low-state levels.

    If S1 is the low-state level, S2 is the high-state level, and U is the upper-reference level, the waveform value corresponding to the upper-reference level is

    S1+U100(S2S1).

    Scope Window Use

    Click the Measurements tab on the Time Scope toolstrip. In the Bilevel section, click Bilevel Settings, and specify the Upper Ref. Level (%) to a positive scalar less than 100.

    Data Types: double

    Mid-reference level, specified as a positive scalar in the range (0 100). The scope uses the mid-reference level to determine when a transition occurs. Specify this value as a percentage of the difference between the high- and low-state levels.

    The mid-reference level in a bilevel waveform with low-state level S1 and high-state level S2 is

    S1+12(S2S1)

    This figure shows the mid-reference level as a horizontal line, and shows its corresponding mid-reference level instant as a vertical line.

    Scope Window Use

    Click the Measurements tab of the Time Scope toolstrip. In the Bilevel section, click Bilevel Settings, and specify the Mid Ref. Level (%) to a positive scalar less than 100.

    Data Types: double

    Lower-reference level, specified as a positive scalar in the range (0 100). The scope uses the lower-reference level to compute the end of a fall time or the start of a rise time. Specify this value as a percentage of the difference between the high- and low-state levels.

    If S1 is the low-state level, S2 is the high-state level, and L is the lower-reference level, the waveform value corresponding to the lower-reference level is

    S1+L100(S2S1).

    Scope Window Use

    Click the Measurements tab on the Time Scope toolstrip. In the Bilevel section, click Bilevel Settings, and specify the Lower Ref. Level (%) to a positive scalar less than 100.

    Data Types: double

    Time duration over which the scope searches for a settling time, specified as a positive scalar in seconds.

    Scope Window Use

    Click the Measurements tab on the Time Scope toolstrip. In the Bilevel section, click Bilevel Settings, and specify the Settle Seek (s) to a positive scalar.

    Data Types: double

    Enable transition measurements, specified as true or false. For more information on the transition measurements that the scope displays, see Transitions Pane (Simulink).

    Scope Window Use

    Click the Measurements tab on the Time Scope toolstrip. In the Bilevel section, select Transitions. A Transitions panel opens at the bottom of the Time Scope window to show the transition measurements.

    Data Types: logical

    Enable aberration measurements, specified as true or false. Aberration measurements include distortion and damping measurements such as preshoot, overshoot, and undershoot. For more information on the aberration measurements that the scope displays, see Overshoots / Undershoots Pane (Simulink).

    Scope Window Use

    Click the Measurements tab on the Time Scope toolstrip. In the Bilevel section, select Aberrations. An Aberrations panel opens at the bottom of the Time Scope window to show the aberration measurements.

    Data Types: logical

    Enable cycle measurements, specified as true or false. These measurements are related to repetitions or trends in the displayed portion of the input signal. For more information on the cycle measurements, see Cycles Pane (Simulink).

    Scope Window Use

    Open the Measurements tab of the Time Scope toolstrip. In the Bilevel section, select Cycles. A Cycle panel opens at the bottom of the Time Scope window and shows the cycle measurements.

    Data Types: logical

    Examples

    collapse all

    Create a sine wave and view it in the Time Scope. Programmatically compute the bilevel measurements related to signal transitions, aberrations, and cycles.

    Initialization

    Create the input sine wave using the sin function. Create a timescope MATLAB® object to display the signal. Set the TimeSpan property to 1 second.

    f = 100;
    fs = 1000;
    swv = sin(2.*pi.*f.*(0:1/fs:1-1/fs)).';
    scope = timescope(SampleRate=fs,...
        TimeSpanSource="property",...
        TimeSpan=1);

    Transition Measurements

    Enable the scope to show transition measurements programmatically by setting the ShowTransitions property to true. Display the sine wave in the scope.

    Transition measurements such as rise time, fall time, and slew rate appear in the Transitions panel at the bottom of the scope.

    scope.BilevelMeasurements.ShowTransitions = true;
    scope(swv);
    release(scope);

    Aberration Measurements

    Enable the scope to show aberration measurements programmatically by setting the ShowAberrations property to true. Display the sine wave in the scope.

    Aberration measurements such as preshoot, overshoot, undershoot, and settling time appear in the Aberrations panel at the bottom of the scope.

    scope.BilevelMeasurements.ShowAberrations = true;
    scope(swv);
    release(scope);

    Cycle Measurements

    Enable the scope to show cycles measurements programmatically by setting the ShowCycles property to true. Display the sine wave in the scope.

    Cycle measurements such as period, frequency, pulse width, and duty cycle appear in the Cycles panel at the bottom of the scope.

    scope.BilevelMeasurements.ShowCycles = true;
    scope(swv);
    release(scope);

    More About

    expand all

    Version History

    Introduced in R2022a