Main Content

Specify Behavioral Constraints

To determine if the numerical behavior of a new fixed-point implementation is acceptable, define constraints by setting signal tolerances, by using one or more model verification blocks, or both.

In theOptimized Fixed-Point Conversionworkflow of the Fixed-Point Tool, or when usingfxpoptat the command line, you must specify at least one behavioral constraint. Data types are optimized to meet all specified constraints.

In theIterative Fixed-Point Conversionworkflow of the Fixed-Point Tool, or when usingDataTypeWorkflow.Converterat the command line, you can specify behavioral constraints to verify the numerical behavior of the model with embedded types. After simulating with embedded types, theWorkflow Browserindicates whether the embedded run meets the specified signal tolerances compared to the range collection run. For more information, seeVerify New Settings.

Specify Signal Tolerances

You can specify tolerances for signals in your model that have signal logging enabled. To enable signal logging,

  • In the Simulink®Editor, select one or more signals.

  • In theSignaltab of the Simulink Editor, clickLog Signals.

In the Fixed-Point Tool, specify individual signal tolerances in the table underSignal Tolerances. The table contains all signals in the model with signal logging enabled. If you log additional signals after opening the Fixed-Point Tool, clickRefresh Signalsto update theSignal Tolerancestable. At the command line, specify tolerances using theaddTolerancemethod.

You can specify any of the following types of tolerances:

  • Abs Tol— Absolute value of the maximum acceptable difference between the original signal and the signal in the converted design.

  • Rel Tol— Maximum relative difference, specified as a percentage, between the original signal and the signal in the converted design. For example, a value of1e-2indicates a maximum relative difference of one percent.

  • Time Tol (seconds)- 时间间隔,其中最大值和最小值定义了要与之比较的上和下值。

You can define a tolerance band using any combination of absolute, relative, and time tolerance values. When you specify the tolerance for your signal using multiple types of tolerances, the overall tolerance band is computed by selecting the most lenient tolerance result for each data point. For more information about how tolerances are computed, seeTolerance Computation.

Use Model Verification Blocks

You can use enabledModel Verificationblocks to specify constraints on the behavior of your system. For examples of data type optimization using model verification blocks, seeOptimize Data Types Using Multiple Simulation Scenariosand图像使用固定点量化的限制性玻尔兹曼机器算法denoing.

See Also

相关话题