Gain
Multiplication of the input signal by a constant.
Description
The Gain block multiplies the value of the input signal by a constant value (gain). The input signal and gain can be scalar, vector or matrix.
The gain is set by the Gain parameter. The Multiplication parameter allows you to specify element-by-element or matrix multiplication. For matrix multiplication, this parameter also allows you to specify the order of multipliers.
The Gain block uses the following rules to calculate the output signal:
-
If the input signal type is of the real type and the gain is complex, the output signal type will be complex.
-
If the input signal type is different from the gain type, Engee attempts to perform a conversion of the gain type to the input signal type. If such a conversion is not possible, the calculation will be stopped and an error message will be displayed. This situation may occur, for example, if the input signal is an unsigned integer (
Uint8
) and the Gain parameter is set to a negative number.
Ports
Input
Port_1 - input signal
scalar
| vector
| matrix
The Gain block supports both real and complex scalar, vector or matrix input signals. If the Gain block input signal is real and the gain is complex, the output signal will be complex.
Data types: Float16
, Float32
, Float64
, Int8
, Int16
, Int32
, Int64
, UInt8
, UInt16
, UInt32
, UInt64
, Bool
.
Support for complex numbers: Yes
Output
Port_1 - input signal multiplied by a gain factor
scalar
| vector
| matrix
Input signal multiplied by the gain. If the input signal of the Gain block is real and the gain is complex, the output signal will be complex.
Data types: Float16
, Float32
, Float64
, Int8
, Int16
, Int32
, Int64
, UInt8
, UInt16
, UInt32
, UInt64
, Bool
.
Parameters
Gain - coefficient by which to multiply the input signal
1.0 (by default)
| `scalar, vector or matrix of any type, except logical `
Specifies the factor by which to multiply the input signal. The gain can be a real or complex scalar, vector or matrix of any type except logic.
Block parameter |
|
Values |
|
By default |
|
Output data type - output data type
Float 64 (by default)
| Float 32
| Float 16
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
Specifies the type of output data.
Output data type method - method for specifying the output data type
Internal rule (by default)
| Same as input
| Specified
Specify the method of setting the output data type.
Block parameter |
|
Values |
|
By default |
|
Parameter data type - parameter data type
Float 64 (By default)
| Float 32
| Float 16
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
Select the data type for the parameter.
Block parameter |
|
Values |
|
* By default* |
|
Parameter data type method - method of specifying the data type for a parameter
Internal rule (by default)
| Same as input
| Same as Gain
| Specified
Specify the method of setting the data type for the parameter:
-
Internal rule
- the block inherits the data type based on an internal rule. -
Same as input
- the block defines the data type the same as the input type. -
Same as Gain
- the block defines the data type the same as theGain
coefficient data type. -
Specified
- data type is user defined.
Block parameter |
|
Values |
|
By default |
|
*Multiplication
- multiplication mode
Element-wise(K.*u) (by default)
| Matrix(K*u)
| Matrix(u*K)
Specify one of these multiplication modes:
-
Element-wise(K.*u)
- each element of the input signal is multiplied by each element of the gain. If necessary, the unit performs expansions so that the input and gain are of equal size. -
Matrix(K*u)
- the input data and gain are multiplied by a matrix using the input data as the second operand. -
Matrix(u*K)
- the input data and gain are multiplied by the matrix using the input data as the first operand.
Suppose K
is a matrix m
over n
. Matrix(K*u)(u vector)
defines the input as a vector of length n
and the output as a vector of length m
. In contrast, Matrix(K*u)
uses propagation to define the dimensions for input and output. For a gain matrix m
by n
, the input can propagate to a matrix n
by q
, and the output becomes a matrix m
by q
.
Block parameter |
|
Values |
|
* By default* |
|