dsp.PeakToPeak System object

Package: dsp

Peak-to-peak value


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.


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.



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 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'


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.


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


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


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


expand all

Peak-to-Peak Value of Vector

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

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


Peak-to-Peak Value of Matrix Input

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

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



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

Introduced in R2012a

Was this topic helpful?