Documentation Center

  • Trial Software
  • Product Updates

Contents

dsp.PeakFinder System object

Package: dsp

Determine extrema (maxima or minima) in input signal

Description

The PeakFinder object determines the extrema (maxima or minima) in the input signal.

To compute the extrema in the input signal:

  1. Define and set up your peak finder. See Construction.

  2. Call step to compute the extrema according to the properties of dsp.PeakFinder. The behavior of step is specific to each object in the toolbox.

Construction

H = dsp.PeakFinder returns a peak finder System object™, H, that compares the current signal value to the previous and next values to determine if the current value is an extremum.

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

Properties

PeakType

Looking for maxima, minima, or both

Specify whether the object is looking for maxima, minima, or both. You can set this property to oMaxima, Minima, Maxima and Minima. The default is Maxima and Minima.

PeakIndicesOutputPort

Enable output of extrema indices

Set this property to true to output the extrema indices. The default is false.

PeakValuesOutputPort

Enable output of extrema values

Set this property to true to output the extrema values. The default is false.

MaximumPeakCount

Number of extrema to look for in each input signal

The object stops searching the input signal for extrema after the maximum number of extrema has been found. The value of this property must be an integer greater than or equal to one. The default is 10.

IgnoreSmallPeaks

Enable ignoring peaks below threshold

Set this property to true if you want to eliminate the detection of peaks whose amplitudes are within a specified threshold of neighboring values. The default is false.

PeakThreshold

Threshold below which peaks are ignored

Specify the noise threshold value. This property defines the current input value as a maximum if:

  • The current input value minus the previous input value is greater than the threshold, and

  • The current input value minus next input value is greater than the threshold.

This property applies when you set the IgnoreSmallPeaks property to true. The default is 0.

 Fixed-Point Properties

Methods

cloneCreate peak finder object with same property values
getNumInputsNumber of expected inputs to the step method
getNumOutputsNumber of outputs of step method
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics changes
stepNumber of extrema in input signal

Examples

Determine whether each value of an input signal is local maximum or minimum:

     hpeaks1 = dsp.PeakFinder;
     hpeaks1.PeakIndicesOutputPort = true;
     hpeaks1.PeakValuesOutputPort = true;
 
     x1 = [9 6 10 3 4 5 0 12]';
     % Find the peaks of each input 
     % [prev;cur;next]: {[9;6;10],[6;10;3],...}
     [cnt1, idx1, val1, pol1] = step(hpeaks1, x1);
 

Determine peak values for a fixed-point input signal:

      hpeaks2 = dsp.PeakFinder('PeakType', 'Maxima', ...
      'PeakValuesOutputPort', true, ...
      'MaximumPeakCount', 2, ...
      'IgnoreSmallPeaks', true, ...
      'PeakThreshold', 0.25, ... 
      'OverflowAction', 'Saturate');
      x2 = fi([-1;0.5;0],true,16,15);
      [cnt2, val2] = step(hpeaks2, x2);

Algorithms

This object implements the algorithm, inputs, and outputs described on the Peak Finder block reference page. The object properties correspond to the block parameters.

See Also

|

Was this topic helpful?