Gain

Purpose

Multiply input signal by constant

Library

Control / Math

Description

../../_images/gain.svg

The Gain block multiplies the input signal with the gain value. The multiplication can either be an element-wise (\(K\cdot u\)) or a matrix multiplication (\(K\ast u\)).

Parameters

Gain

The gain value to multiply with the input signal. For element-wise multiplication the gain value can be a scalar or a vector matching the width of the input signal. For matrix multiplication the gain value can be a scalar, a vector or a matrix which has as many columns as the width of the input signal.

Multiplication

Specifies whether element-wise (\(K\cdot u\)) or matrix multiplication (\(K\ast u\)) should be used.

Output data type

The data type of the output signal. See Data Types. If you choose inherited, the minimum data type is int8_t.

Data type overflow handling

Specifies how a data type overflow is handled. See Data Types. This parameter only appears if Output data type is not set to a floating-point data type.

Gain data type

The data type of the gain parameter. By choosing a suitable data type, the computational effort for fixed-point multiplications can be minimized. If you choose inherited, it is set to the output data type. This parameter only appears if Multiplication is set to element-wise and Output data type is set to a fixed-point data type.

Probe Signals

Input

The input signal.

Output

The output signal.