Fixed-Point Blockset
  Go to block:
    Search    Help Desk 
FixPt FIR    Examples

The FixPt FIR block is a masked S-function that samples and holds the n most recent inputs, multiplies each input by a specified value (its FIR coefficient), and stacks them in a vector. This block supports both single-input/single-output (SISO) and single-input/multi-output (SIMO) modes.

For the SISO mode, the FIR coefficients parameter is specified as a row vector. For the SIMO mode, the FIR coefficients are specified as a matrix where each row corresponds to a separate output.

The Initial condition parameter provides the initial values for all times preceding the start time in the FIR realization. The time interval between samples is specified with the Sample time parameter.

The Parameter data type parameter can have the same values as the Output data type parameter as discussed in "Block Parameters". Additionally, if Parameter data type is a generalized fixed-point number, then you can select from these scaling modes:

If the FIR coefficients are specified as a row vector, then scaling element-wise and column-wise produce the same result, while scaling matrix-wise and row-wise produce the same result.

For a description of all other parameters, refer to "Block Parameters".

The block icon displays a graph of the FIR coefficients unless the SIMO mode is used. When a coefficient is changed on the block's dialog box, the graph is automatically redrawn when you press the Apply or OK button. For a description of how the block icon displays the output data type, refer to "Block Icon Display".

Parameters and Dialog Box

FIR coefficients
FIR coefficients. One row per output.
Initial condition
Initial values for all times preceding the start time.
Sample time
Sample time.
Parameter data type
Any data type supported by the Fixed-Point Blockset.
Parameter scaling
Radix point-only or slope/bias scaling. Additionally, the FIR coefficients vector or matrix can be scaled using the constant vector or constant matrix scaling modes for maximizing precision. These scaling modes are only available for generalized fixed-point data types.
Output data type
Any data type supported by the Fixed-Point Blockset.
Output scaling
Radix point-only or slope/bias scaling. These scaling modes are only available for generalized fixed-point data types.
Lock output scaling
If checked, Output scaling is locked. This feature is only available for generalized fixed-point output.
Round toward
Rounding mode for the fixed-point output.
Saturate to max or min when overflows occur
If checked, fixed-point overflows saturate. Otherwise, they wrap.
Override with doubles
If checked, the Output data type is overridden with doubles.
Log minimums and maximums
If checked, minimum and maximum simulation values are logged to the workspace.

Conversions and Operations

The FIR coefficients parameter is converted from doubles to the specified data type offline using round-to-nearest and saturation.The Initial condition parameter is converted from doubles to the input data type offline using round-to-nearest and saturation. Refer to "Parameter Conversions" in the manual for more information about parameter conversions.

The FixPt FIR block first multiplies its inputs by the FIR coefficients parameter, converts those results to the output data type using the specified rounding and overflow modes, and then carries out the summation. Refer to "Rules for Arithmetic Operations" in the manual for more information about the rules this block adheres to when performing operations.

Characteristics

Input Ports
Any data type supported by the blockset -- it must be a scalar
Output Port
Any data type supported by the blockset
Direct Feedthrough
Yes
Sample Time
Specified as a parameter
Scalar Expansion
Of initial conditions
States
One less than the columns in the FIR coefficients vector or matrix
Vectorized
No

Example

Suppose you want to configure this block for two outputs (SIMO mode) where the first output is given by

the second output is given by

and the initial values of u(k - 1) and u(k - 2) are given by ic1 and ic2, respectively. To configure the FixPt FIR block for this situation, you must specify the FIR coefficient parameter as [a1 b1 c1; a2 b2 c2] where
c2 = 0, and the Initial condition parameter as [ic1 ic2].



[ Previous | Help Desk | Next ]