Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

dsp.PeakToPeak System object

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

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

ptp = dsp.PeakToPeak('PropertyName',PropertyValue,...) returns an PeakToPeak System object, ptp, 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

resetReset the running peak-to-peak object
stepCompute peak-to-peak value
Common to All System Objects
clone

Create System object with same property values

getNumInputs

Expected number of inputs to a System object

getNumOutputs

Expected number of outputs of a System object

isLocked

Check locked states of a System object (logical)

release

Allow System object property value changes

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.

in = (1:10)';
ptp = dsp.PeakToPeak;
y = ptp(in)
y = 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.

in = magic(4);
ptp = dsp.PeakToPeak;
ptp.Dimension = 'All';
y = ptp(in)
y = 15

References

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

Extended Capabilities

Introduced in R2012a

Was this topic helpful?