dsp.Maximum System object

Package: dsp

Find maximum value of input or sequence of inputs

Description

The Maximum object finds the maximum values of an input or sequence of inputs.

To compute the maximum value of an input or sequence of inputs:

  1. Define and set up your System object™. See Construction.

  2. Call step to find the maximum according to the properties of dsp.Maximum. The behavior of step is specific to each object in the toolbox.

Construction

H = dsp.Maximum returns an object, H, that computes the value and index of the maximum elements in an input or a sequence of inputs along the specified Dimension.

H = dsp.Maximum('PropertyName',PropertyValue,...) returns a maximum-finding object, H, with each specified property set to the specified value.

Properties

ValueOutputPort

Output maximum value

Set this property to true in order to output the maximum of the input. This property applies only when you set the RunningMaximum property to false. The default is true.

RunningMaximum

Calculate over single input or multiple inputs

When you set this property to true, the object computes the maximum value over successive calls to the step method. When you set this property to false, the object computes the maximum value over the current input. The default is false.

IndexOutputPort

Output index of maximum value

Set this property to true to output the index of the maximum value of the input. This property applies only when you set the RunningMaximum property to false. The default is true.

ResetInputPort

Additional input to enable resetting of running maximum

Set this property to true to enable resetting the running maximum. When you set this property to true, you must specify a reset input to the step method to reset the running maximum. This property applies only when you set the RunningMaximum property to true. The default is false.

ResetCondition

Condition that triggers resetting of running maximum

Specify the event that resets the running maximum as one of | Rising edge | Falling edge | Either edge | Non-zero |. This property applies only when you set the ResetInputPort property to true. The default is Non-zero.

IndexBase

Numbering base for index of maximum value

Specify whether to start the index numbering from One or Zero when computing the index of the maximum value. This property applies only when you set the IndexOutputPort property to true. The default is One.

Dimension

Dimension to operate along

Specify how the maximum calculation is performed over the data as one of | All | Row | Column | Custom |. This property applies when you set the RunningMaximum property to false. The default is Column.

CustomDimension

Numerical dimension to calculate over

Specify the integer dimension of the input signal over which the object finds the maximum. The cannot exceed the number of dimensions in the input signal. This property only applies when you set the Dimension property to Custom. The default is 1.

ROIProcessing

Enable region-of-interest processing

Set this property to true to enable calculation of the maximum value within a particular region of an image. This property applies when you set the Dimension property to All and the RunningMaximum property to false. The default is false.

For full ROI processing support, install the Computer Vision System Toolbox™ product. If you only have the DSP System Toolbox™ product installed, you can only specify the value of the ROIForm property as Rectangles.

ROIForm

Type of region of interest

Specify the type of region of interest as one of | Rectangles | Lines | Label matrix | Binary mask |. This property applies only when you set the ROIProcessing property to true. The default is Rectangles.

For full ROI processing support, install the Computer Vision System Toolbox product. If you have only the DSP System Toolbox product installed, you can only specify the as Rectangles.

ROIPortion

Calculate over entire ROI or just perimeter

Specify whether to calculate the maximum over the Entire ROI or the ROI perimeter. This property applies only when you set the ROIForm property to Rectangles. The default is Entire ROI.

ROIStatistics

Calculate statistics for each ROI or one for all ROIs

Specify whether to calculate Individual statistics for each ROI or a Single statistic for all ROIs. This property applies only when you set the ROIForm property to Rectangles, Lines, or Label matrix.

ValidityOutputPort

Output flag indicating if any part of ROI is outside input image

When you set the ROIForm property to one of | Lines | Rectangles |, set this property to true to return the validity of the specified ROI being completely inside of the image. When you set the ROIForm property to Label Matrix, set this property to true to return the validity of the specified label numbers. The default is false.

FrameBasedProcessing

Process input as frames or samples

Set this property to true to enable frame-based processing for 2-D inputs. Set this property to false to enable sample-based processing. The object always performs sample-based processing for N-D inputs where N is greater than 2. This property applies when you set the RunningMaximum to true. The default is true.

 Fixed-Point Properties

Methods

cloneCreate maximum-finding object with same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs of step method
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics changes
resetReset computation of running maximum
stepMaximum value

Examples

Find a maximum value and its index:

 hmax1 = dsp.Maximum;
 x = randn(100,1);
 [y, I] = step(hmax1, x);

Compute a running maximum:

 hmax2 = dsp.Maximum;
 hmax2.RunningMaximum = true;
 x = randn(100,1);
 y = step(hmax2, x);
 % y(i) is the maximum of all values in the vector x(1:i)

Algorithms

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

Treat sample-based row input as a column block parameter is not supported by the dsp.Maximum object.

Both this object and its corresponding block let you specify whether to process inputs as individual samples or as frames of data. The object uses the FrameBasedProcessing property. The block uses the Input processing parameter. See Set the FrameBasedProcessing Property of a System object for more information.

Was this topic helpful?