Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

dsp.PeakToPeak System object

Package: dsp

Peak-to-peak value

Description

The PeakToPeak object computes the peak-to-peak value of an input.

To obtain the peak-to-peak value:

  1. Define and set up your peak-to-peak calculation. See Construction.

  2. Call step to compute the peak-to-peak value for an input vector according to the properties of dsp.PeakToPeak. The behavior of step is specific to each object in the toolbox.

    Note:   Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

Construction

H = dsp.PeakToPeak creates a peak-to-peak System object, H, that computes the difference between the maximum and minimum value in an input or a sequence of inputs.

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

Properties

CustomDimension

Dimension to operate along. Specify the dimension as a positive integer along which the peak-to-peak difference is computed. The value of this property cannot exceed the number of dimensions in the input signal. This property applies when the Dimension property is 'Custom'.

Default: 1

Dimension

Dimension to operate along. Specify the dimension along which to calculate the peak-to-peak ratio as one of 'All', 'Row', 'Column', or 'Custom'. This property applies when the RunningPeakToPeak property is false. If you set this property to 'Custom', specify the dimension using the CustomDimension property.

Default: 'Column'

ResetCondition

Reset condition for running peak-to-peak mode. Specify the event to reset the running peak-to-peak as one of 'Rising edge', 'Falling edge', 'Either edge', or 'Non-zero'. This property applies when the ResetInputPort property is true.

ResetInputPort

Enables resetting in running peak-to-peak mode. Set this property to true to enable resetting the running peak-to-peak. When the property is set to true, a reset input must be specified to the call of step to reset the running peak-to-peak difference. This property applies when the RunningPeakToPeak property is true.

Default: false

RunningPeakToPeak

Calculation over successive calls to step. Set this property to true to enable the calculation of the peak-to-peak difference over successive calls to the step.

Default: false

Methods

cloneClones the current instance of the peak-to-peak 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
releaseAllow property value and input characteristics changes
resetReset the running peak-to-peak object
stepCompute peak-to-peak value

Examples

expand all

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).

Determine the peak-to-peak value for a vector input.

in1 = (1:10)';
h1 = dsp.PeakToPeak;
y1 = h1(in1)
y1 =

     9

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).

Determine the peak-to-peak value of a matrix input.

in2 = magic(4);
h2 = dsp.PeakToPeak;
h2.Dimension = 'All';
y2 = h2(in2)
y2 =

    15

References

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

Introduced in R2012a

Was this topic helpful?