Documentation Center

  • Trial Software
  • Product Updates

dsp.PulseMetrics System object

Package: dsp

Pulse metrics of bilevel waveforms

Description

The PulseMetrics object computes rise times, fall times, pulse widths, and cycle metrics including pulse period, pulse separation, and duty cycle for bilevel waveforms.

To obtain pulse metrics for a bilevel waveform:

  1. Define and set up your pulse metrics. See Construction.

  2. Call step to compute the pulse metrics according to the properties of dsp.PulseMetrics. The behavior of step is specific to each object in the toolbox.

Construction

H = dsp.PulseMetrics creates a pulse metrics System object™, H. The object computes the rise time, fall time, and width of a pulse. dsp.PulseMetrics also computes cycle metrics such as pulse separations, periods, and duty cycles. Because a pulse contains two transitions, the object contains a superset of the capability defined in dsp.TransitionMetrics.

H = dsp.PulseMetrics('PropertyName',PropertyValue,...) returns a PulseMetrics System object, H, with each specified property set to the specified value.

Properties

CycleOutputPort

Enable cycle metrics. If CycleOutputPort is true, cycle metrics are reported for each pulse period.

Default: false

MaximumRecordLength

Maximum samples to preserve between calls to step. This property requires a positive integer that specifies the maximum number of samples to save between calls to the step method. When the number of samples to be saved exceeds this length, the oldest excess samples are discarded. This property applies when the RunningMetrics property is true and is tunable.

Default: 1000

PercentReferenceLevels

Lower-, middle-, and upper-percent reference levels. This property contains a three-element numeric row vector that contains the lower-, middle-, and upper-percent reference levels. These reference levels are used as an offset between the lower and upper states of the waveform when computing the duration of each transition.

Default: [10 50 90]

PercentStateLevelTolerance

Tolerance of the state level (in percent). This property requires a scalar that specifies the maximum deviation from either the low or high state before it is considered to be outside that state. The tolerance is expressed as a percentage of the waveform amplitude.

Default: 2

Polarity

Polarity of pulse to extract. This property specifies the type of pulse to extract by the polarity of the leading transition. Valid values for this property are 'positive' or 'negative'.

Default: 'positive'

PostshootOutputPort

Enable posttransition aberration metrics. If this property is set to true, overshoot and undershoot metrics are reported for a region defined immediately after each transition. The posttransition aberration region is defined as the waveform interval that begins at the end of each transition and whose duration is the value of PostshootSeekFactor times the computed transition duration. If a complete subsequent transition is detected before the interval is over, the region is truncated at the start of the subsequent transition. The metrics are computed for each transition that has a complete posttransition aberration region.

Default: false

PostshootSeekFactor

Corresponds to the duration of time to search for the overshoot and undershoot metrics immediately following each transition. The duration is expressed as a factor of the duration of the transition. This property is enabled only when the PostshootOutputPort property is set to true and is tunable.

Default: 3

PreshootOutputPort

Enable pretransition aberration metrics. If PreshootOutputPort is set to true, overshoot and undershoot metrics are reported for a region defined immediately before each transition. The pretransition aberration region is defined as the waveform interval that ends at the start of each transition and whose duration is PreshootSeekFactor times the computed transition duration.

Default: 'false'

PreshootSeekFactor

Corresponds to the duration of time to search for the overshoot and undershoot metrics immediately preceding each transition. The duration is expressed as a factor of the duration of the transition. This property is enabled only when the PreshootOutputPort property is set to true and is tunable.

Default: 3

RunningMetrics

Enable metrics over all calls to step. If RunningMetrics is set to false, metrics are computed for each call to step independently. If RunningMetrics is set to true, metrics are computed across subsequent calls to step. If there are not enough samples to compute metrics associated with the last transition, posttransition aberration region, or settling seek duration in the current record, the object will defer reporting all transition, aberration, and settling metrics associated with the last transition until a subsequent call to step is made with enough data to compute all enabled metrics for that transition.

Default: false

SampleRate

Sampling rate of uniformly-sampled signal. Specify the sample rate in hertz as a positive scalar. This property is used to construct the internal time values that correspond to the input sample values. Time values start with zero. This property applies when the TimeInputPort property is set to false.

Default: 1

SettlingOutputPort

Enable settling metrics. If the SettlingOutputPort property is set to true, settling metrics are reported for each transition. The region used to compute the settling metrics starts at the midcrossing and lasts until the SettlingSeekDuration has elapsed. If an intervening transition occurs, or the signal has not settled within the PercentStateLevelTolerance of the final level, NaN is returned for each metric. If there are not enough samples after the last transition to complete the SettlingSeekDuration, no metrics are reported for the last transition. The metrics are reported for the transition the next time step is called if the RunningMetrics property is set to true.

Default: false

SettlingSeekDuration

Duration of time over which to search for settling. This property value is a scalar that specifies the amount of time to inspect from the mid-reference level crossing (in seconds). If the transition has not yet settled, or a subsequent complete transition is detected within this duration, the PulseMetrics object will report NaN for all settling metrics. This property is tunable and applies only when you set the SettlingOutputPort property to true.

Default: 0.02

StateLevels

Low- and high-state levels. This property is a 2–element numeric row vector that contains the low- and high-state levels respectively. These state levels correspond to the nominal logic low and high levels of the pulse waveform. This property is tunable.

Default: [0 2.3]

StateLevelsSource

Auto or manual state-level computation. If StateLevelsSource is set to 'Auto', the first record sent to step is sent to dsp.StateLevels with the default settings to determine the state levels of the incoming waveform. If this property is set to 'Property', the object uses the values the user specifies in the StateLevels property.

Default: 'Property'

TimeInputPort

Add input to specify sample instants. Set TimeInputPort to true to enable an additional real input column vector to step to specify the sample instants that correspond to the sample values. If this property is false, the sample instants are built internally. The sample instants start at zero and increment by the reciprocal of the SampleRate property for subsequent samples. The sample instants continue to increment if the RunningMetrics property is set to true and no intervening calls to the reset or release methods are encountered.

Default: false

TransitionOutputPort

Enable transition metrics. If the TransitionOutputPort property is set to true, transition metrics are reported for the initial and final transitions of each pulse.

Default: false

Methods

cloneClones the current instance of the pulse metrics object
getNumInputsNumber of expected inputs to the step method
getNumOutputsNumber of outputs of the step method
isLockedLocked status (logical) for input attributes and nontunable properties
plotPlots signal and metrics computed in last call to step
resetReset the running pulse metrics object
stepPulse metrics of bilevel waveforms

Examples

expand all

Width, Period, and Duty Cycle

Determine the width, period, and duty cycle of a 5 V pulse sampled at 4 MHz.

Load the data and sampling instants.

 load('pulseex.mat', 'x', 't');

Construct your pulse metrics System object. Set the TimeInputPort property to true to specify the sampling instants as an input to step. Set the CycleOutputPort property to true to obtain metrics for each pulse. Because the input is a 5V pulse, set the StateLevels property to [0 5].

 hpm1 = dsp.PulseMetrics('TimeInputPort',true, ...
                            'CycleOutputPort', true, ...
                            'StateLevels',[0 5])

Call step to compute the cycle metrics and plot the result.

 [pulse, cycle] = step(hpm1,x,t);
 plot(hpm1)
 text(t(2),-0.5,['Duty Cycle: ',num2str(cycle.DutyCycle)]);

Slew Rates for 2.3 V Digital Clock

Find the slew rates of the leading and trailing edges of a 2.3 V digital clock sampled at 4 MHz.

Construct your pulse metrics System object. Set the TransitionOutputPort property to true to report transition metrics for the initial and final transitions. Set the StateLevelsSource property to 'Auto' to estimate the state levels from the data.

 hpm2 = dsp.PulseMetrics('SampleRate',4e6, ...
                            'TransitionOutputPort', true, ...
                            'StateLevelsSource','Auto');

Compute the pulse and transition metrics and plot the result.

 [pulse, transition] = step(hpm2,x);
 plot(hpm2)

References

[1] IEEE® Standard on Transitions, Pulses, and Related Waveforms, IEEE Standard 181, 2003.

See Also

|

Was this topic helpful?