Engee documentation

Convolution

Reconciliation of two input data.

convolution

Description

The Convolution block performs convolution of the first dimension of the multidimensional input array with the first dimension of the multidimensional input array . The block may also perform convolution of the vector-column with the first dimensionality of the multidimensional input array.

The general equation for convolution is as follows:

Two blocks of the Engee Digital Signal Processing library are suitable for convolution of two input signals:

  • Convolution

  • Discrete FIR Filter

The Convolution block assumes that all elements of and are available at each time step and computes the entire convolution at each time step.

The Discrete FIR Filter block can be used to convolve signals in situations where all elements of are available at each time step, but is a sequence that arrives during the entire simulation time. When using the Discrete FIR Filter block, the convolution is calculated only once.

Ports

Input

Port_1 - first input signal
scalar | vector | matrix| multidimensional array

The first input signal, , as a scalar, vector, matrix or multidimensional array.

If both inputs are real, the output signal is real. If one or both inputs are complex, the output signal is complex. All input port dimensions for both inputs, except the first one, must have the same value.

The inputs and are zero if they are indexed outside their valid ranges.

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool.

Support for complex numbers: Yes

Port_2 - second input signal
scalar | vector | matrix| multidimensional array

The second input signal, , as a scalar, vector, matrix or multidimensional array.

If both inputs are real, the output signal is real. If one or both inputs are complex, the output signal is complex. All input port dimensions for both inputs, except the first one, must have the same value.

The inputs and are zero if they are indexed outside their valid ranges.

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool.

Support for complex numbers: Yes

Output

Port_1 - output signal
scalar | vector | matrix | multidimensional array

A collapsed signal, as a scalar, vector, matrix or multidimensional array.

If both inputs are real, the output signal is real. If one or both inputs are complex, the output signal is complex.

Data types: Float64.

Support for complex numbers: Yes

Parameters

Main

Computation domain - computation domain
Time (by default) | Frequency | Fastest

Set the convolution computation domain:

Time - the block calculates in the time domain, which minimises memory usage.

Fixed point signals are only supported in the time domain. When inputting fixed point signals, make sure that the Computation domain parameter is set to Time.

Read More

Selecting the right convolution unit

Question Answer Recommended block

How many convolutions are you going to perform

Many convolutions, one at each time step

  • Block *Convolution

One convolution for the entire simulation period

*Convolution block

  • Block Discrete FIR Filter

What is the length of the input sequences

Both sequences are of finite length

  • Block *Convolution

  • Block Discrete FIR Filter

One sequence has an infinite (not predefined) length

  • Discrete FIR Filter block

How many inputs are scalar streams

None

  • Block *Convolution

  • Block Discrete FIR Filter

One or both

Buffer block followed by Convolution block

  • Discrete FIR Filter block

Converting two multidimensional arrays

The Convolution block always calculates the convolution of two multidimensional input arrays along the first dimension. When both input arrays are multidimensional arrays, the size of their first dimension may be different, but the sizes of all other dimensions must be the same. For example, if is an array Mu by N by P, and is an array Mv by N by P, the output is an array (Mu+Mv-1) by N by P.

If is a matrix Mu on N and is a matrix Mv on N, then the output of is a matrix (Mu+Mv-1) on N whose jth column consists of such elements

The inputs and are zero if they are indexed outside their ranges. If both inputs are real, the output is real. If one or both inputs are complex, the output is a complex vector.

Vector-column convolution with a multidimensional array

If one input is a column vector and the other is a multidimensional array, the block independently convolves the vector with the first dimension of the multidimensional array. For example, if is a column vector Mu by 1 and is a matrix Mv by N, the output is a matrix (Mu+Mv-1) by N whose jth column consists of these elements:

A convolution of two column vectors

The Convolution block also takes two column vectors as input. If and are column vectors with lengths Mu and Mv, the Convolution block performs a convolution of vectors with lengths Mu and Mv such that:

The output is a column vector (Mu+Mv-1) by 1.