dsp.CumulativeProduct System object

Package: dsp

Cumulative product of channel, column, or row elements

Description

The CumulativeProduct object computes the cumulative product of channel, column, or row elements.

To compute the cumulative product of channel, column, or row elements:

  1. Define and set up your cumulative product object. See Construction.

  2. Call step to compute the cumulative product according to the properties of dsp.CumulativeProduct. The behavior of step is specific to each object in the toolbox.

Construction

H = dsp.CumulativeProduct returns a cumulative product object, H, that computes the cumulative product of input matrix or input vector elements along the default Dimension.

H = dsp.CumulativeProduct('PropertyName',PropertyValue,...) returns a cumulative product object, H, with each specified property set to the specified value.

Properties

Dimension

Computation dimension for cumulative product

Specify the computation dimension as one of | Channels (running product) | Rows | Columns |. The default is Channels (running product).

ResetInputPort

Enable resetting cumulative product via input port

Set this property to true to enable resetting the cumulative product. When you set this property to true, specify a reset signal to the step method to reset the cumulative product. You can access this property when the Dimension property is set to Channels (running product). The default is false.

ResetCondition

Reset condition for cumulative product

Specify the event on the reset input port that causes resetting the cumulative product to one of | Rising edge | Falling edge | Either edge | Non-zero |. This property applies when you set the ResetInputPort property to true and the Dimension property to Channels (running product). The default is Rising edge.

FrameBasedProcessing

Enable frame-based processing

Set this property to true to enable frame-based processing. Set this property to false to enable sample-based processing. You can access this property when the Dimension property is set to Channels (running product). The default is false.

 Fixed-Point Properties

Methods

cloneCreate cumulative product 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 running cumulative product
stepCumulative product of input along specified dimension for input

Examples

Compute the cumulative product of a matrix:

 hcprod = dsp.CumulativeProduct;
 x = magic(2);
 y = step(hcprod,x);
 y = step(hcprod,x)

Algorithms

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

The Reset port block parameter corresponds to both the ResetCondition and ResetInputPort object properties.

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?