Engee documentation

Cumulative Product

Partial product of channel, column or row elements.

cumulative product

Description

The Cumulative Product block calculates the partial (intermediate) product by the given input measurement or by time (current product).

The input can be a vector or a matrix.

Characteristics of input and output signals

Correct input signal

The Cumulative Product block accepts vector or matrix input signals containing real or complex values.

Correct reset signal

The optional reset port Rst accepts scalar values, which can be any data type supported by Engee, including Bool. The quantisation frequency of the signal on the Rst port must be the same or less than the quantisation frequency of the input signal. The input calculation step of the Rst port must be a positive integer multiple of the input signal calculation step.

Calculation of the product by channels

If the Multiply input along parameter is set to Channels (running product), the block calculates the partial product of the elements in each input channel. The partial product of each input takes into account the partial (intermediate) product of all previous values. In this mode, you must also specify a value for the Input processing parameter. If it is set to Columns as channels (frame based), the block calculates the partial product along each column of the input signal. If Input processing is set to Elements as channels (sample based), the block calculates the partial product for each element of the input over time.

Calculating the current product for each column of the input signal

If the Input processing parameter is set to Columns as channels (frame based), the block processes each input column as an independent channel. As shown in the following figure and equation, the output signals have the following characteristics:

  • The first row of the first output is the same as the first row of the first input.

  • The first line of each subsequent output is the element-by-element product of the first line of the current input signal (time ) and the last line of the previous output signal (time , where is the frame period).

  • Output signals have the same size, dimension and data type as input signals.

If the input of block is a matrix M by N, then the output of is a matrix M by N, the first row of which consists of elements of

cum prod running framebased

Calculating the partial product for each element of the input signal

If the Input processing parameter is set to Elements as channels (sample based), the block processes each element of the input matrix as an independent channel. As shown in the following figure and equation, the output signals have the following characteristics:

  • The first output is the same as the first input.

  • Each subsequent output is the element-by-element product of the current input (time ) and the previous output (time , where is the calculation step).

  • The output data has the same size, dimensionality, and data type as the input data.

If the input of a block is an M by N matrix, then the output is an M by N matrix

For convenience, when multiplying by channels, the block treats the input undirected vector of length M as a column vector of size M by 1. In such cases, the output is an undirected vector of length M.

cum prod running samplebased

Resetting the partial product

When you calculate a partial product, you can configure the block to reset whenever it detects a reset event on the optional Rst port. The quantisation frequency of the signal on port Rst must be the same or less than the quantisation frequency of the input signal. The input calculation step of the Rst port must be a positive integer multiple of the input signal calculation step. The signal on the Rst port can be any data type supported by Engee, including Bool.

If a reset event occurs when the block is performing sample-based processing, the block initialises the current output with the values of the current input. If a reset event occurs when the block performs frame-based processing, the block initialises the first line of the current output with the values in the first line of the current input.

The Reset port parameter specifies the reset event, which can be one of:

  • None - disables the Rst port.

  • Rising edge - starts the reset operation when the signal on the Rst input:

    • Rises from negative value to positive or zero.

    • Rises from zero to a positive value (is not a continuation of the rise from negative to zero).

rising edge

  • Falling edge - starts the reset operation when the signal at the Rst input:

    • Decreases from positive value to negative or zero.

    • Decreases from zero to negative (is not a continuation of the decrease from positive to zero).

falling edge

  • Either edge - starts a reset operation if either of the Rising edge or Falling edge conditions (as described above) is met.

  • Non-zero sample - initiates the reset operation if the value at the Rst input is not equal to zero.

Multiplication by columns

If the Multiply input along parameter is set to Columns, the block calculates the partial product of each column of the input. In this mode, the current partial product is independent of the partial products of the previous values. The output signals have the same size, dimensionality and data type as the input. The Mth output row is the element-by-element product of the first m input rows.

If the input of block is an M by N matrix, then the output of is an M by N matrix, the j-th column of which consists of the elements of the

In column multiplication, the block treats an input undirected vector of length M as a column vector of size M by 1.

ch block ref a to g163

Multiplication along the rows

If the Multiply input along parameter is set to Rows, the block calculates the partial product of the row elements. In this mode, the current partial product is independent of the partial products of previous values.

The output signals have the same size, dimension and data type as the input signals. The N-th output column is the element-by-element product of the first n input columns.

If the input of block is a matrix M by N, the output of is a matrix M by N, the i-th row of which consists of elements of

In string multiplication, the block treats an input undirected vector of length M as a vector-string of size 1 by N.

ch block ref a to g297

Parameters

Multiply input along - dimension of multiplication
Channels (running product) (by default) | Columns | Rows

The dimension by which the cumulative product is calculated.

Input processing - input processing method
Columns as channels (frame based) (by default) | Elements as channels (sample based)

Specifies how the block should process the input when calculating the current product by input channels.

You can set this parameter to one of the following options:

Columns as channels (frame based) -when you select this option, the block treats each column of the input as a separate channel.

Elements as channels (sample based) -when you select this option, the unit treats each input element as a separate channel.

Dependencies

This option is used when Multiply input along is set to Channels (running product).

Reset port - reset event
None (by default) | Rising edge | Falling edge | Either edge | Non-zero sample.

Defines the reset event that causes the block to reset the product across channels. The quantisation frequency of the signal on port Rst must be the same or less than the quantisation frequency of the input signal. The input calculation step at port Rst must be a positive integer multiple of the input signal calculation step.

Dependencies

This parameter is available only when Multiply input along is set to Channels (running product).