Convolution
Convolution of two input data.
blockType: Convolution
Path in the library:
|
Description
Block Convolution performs convolution of the first dimension of a multidimensional input array with the first dimension of the multidimensional input array . The block can also perform convolution of a vector column with the first dimension of a multidimensional input array.
The general equation for convolution is:
Two blocks of the Digital Signal Processing Engee library are suitable for convolution of two input signals.:
-
Convolution;
-
Discrete FIR Filter.
Block Convolution assumes that all the elements and available at each time step and calculates the entire convolution at each step.
Block Discrete FIR Filter It can be used to convolve signals in situations where all the elements available at each time step, but — this is the sequence that arrives during the entire simulation time. When using the block Discrete FIR Filter the convolution is calculated only once.
Ports
Entrance
Port_1 is the first input signal of
scalar
| vector
| matrix
| multidimensional array
The first input signal, , in the form of a scalar, vector, matrix, or multidimensional array.
If both inputs are real, then the output signal is real. If one or both inputs are complex, the output signal is complex. All dimensions of the input ports for both inputs, except the first one, must have the same value.
Entrances and are equal to zero if they are indexed outside their acceptable ranges.
Data types: Float16
, Float32
, Float64
, Int8
, Int16
, Int32
, Int64
, UInt8
, UInt16
, UInt32
, UInt64
, Bool
Support for complex numbers: Yes
Port_2 — the second input signal is
scalar
| vector
| matrix
| multidimensional array
The second input signal, , in the form of a scalar, vector, matrix, or multidimensional array.
If both inputs are real, then the output signal is real. If one or both inputs are complex, the output signal is complex. All dimensions of the input ports for both inputs, except the first one, must have the same value.
Entrances and are equal to zero if they are indexed outside their acceptable 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, in the form of a scalar, vector, matrix, or multidimensional array.
If both inputs are real, then 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
Calculation domain — calculation domain
Time (default)
| Frequency
| Fastest
Set the area of the convolution calculation:
Time
— the block calculates in the time domain, which minimizes memory usage.
Fixed-point signals are supported only in the time domain. When entering fixed-point signals, make sure that the Calculation domain parameter is set to Time
.
More detailed
Selecting the appropriate convolution block
Question | Answer | Recommended block |
---|---|---|
How many bundles are you going to complete |
There are many convolutions, one at each time step |
|
One convolution for the entire simulation period |
|
|
What is the length of the input sequences? |
Both sequences have a finite length. |
|
One sequence has an infinite (not predefined) length. |
|
|
How many inputs are scalar streams |
Not a single one |
|
One or both |
|
Convolution of two multidimensional arrays
Block Convolution it always calculates the convolution of two multidimensional input arrays by the first dimension. When both input arrays are multidimensional arrays, the size of their first dimension may differ, but the sizes of all other dimensions must be the same. For example, if — an array of Mu by N by P, and — an array of Mv by N by P, then the output is an array (Mu+Mv-1) by N by P.
If — the matrix Mu by N, and is the matrix Mv by N, then the result is there will be a matrix (Mu+Mv-1) by N, the jth column of which consists of such elements
Entrances and are equal to zero if they are indexed outside their ranges. If both inputs are real, then the output is real. If one or both inputs are complex, then the output is a complex vector.
Convolution of a column vector 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 — column vector Mu by 1, and is a matrix Mv by N, then the output is a matrix (Mu+Mv-1) by N, the jth column of which consists of these elements: