Fixed-Point Blockset | ![]() ![]() |
Multiply the input by a constant
Description
The FixPt Gain block is a masked S-function that multiplies the input by a constant value (referred to as the gain). To multiply the input by a constant matrix, use the FixPt Matrix Gain block.
You specify the gain with the Gain value parameter. The gain can be a scalar or a vector. You specify the scaling for the gain with the Parameter scaling parameter. Note that there are two dialog box parameters that control the gain scaling: one associated with an edit field, and one associated with a parameter list. If Parameter data type is a generalized fixed-point number such as sfix(16)
, the Parameter scaling list provides you with these scaling modes:
Use Specified Scaling
- This mode uses the slope/bias or radix point-only scaling specified for the editable Parameter scaling parameter (for example, 2^-10
).Best Precision: Element-wis
e - This mode produces radix points such that the precision is maximized for each element of the Gain value vector.Best Precision: Vector-wise
- This mode produces a common radix point for each element of the Gain value vector based on the best precision for the largest value of the vector.For a detailed description of all other block parameters, refer to Block Parameters.
Parameters and Dialog Box
Conversions and Operations
The Gain value parameter is converted from doubles to the specified data type offline using round-to-nearest and saturation. Refer to Parameter Conversions for more information about parameter conversions.
The FixPt Gain block first multiples its inputs by the Gain value parameter, and then converts those results to the output data type using the specified rounding and overflow modes. Refer to Rules for Arithmetic Operations for more information about the rules this block adheres to when performing operations.
Characteristics
![]() | FixPt FIR | FixPt Gateway In | ![]() |