Documentation

Autoscaling Using the Fixed-Point Tool

The Fixed-Point Tool automates the task of specifying fixed-point data types in a Simulink® model. This process is also known as autoscaling. The tool can collect range data for model objects from:

  • Design minimum and maximum values that objects specify explicitly

  • Logged minimum and maximum values that occur during simulation

  • Minimum and maximum values derived using range analysis

Based on these values, the tool proposes fixed-point data types that maximize precision and cover the range.

Workflow for Automatic Data Typing

Before you begin conversion, you need to set up the model in Simulink. For more detail, see Set up the model.

The conversion workflow consists of four main stages.

  1. Prepare System for Conversion

    During this stage of the conversion, select the system to convert to fixed point. The Fixed-Point Tool will propose data types for the objects in the specified system. You can also run the Fixed-Point Advisor. The Fixed-Point Advisor analyzes your model and makes configuration recommendations for autoscaling by the Fixed-Point Tool.

  2. Collect Ranges

    At this stage of the conversion, select whether to collect ranges through simulation, or derived range analysis. Then, run the simulation or the derivation. When the simulation or derivation is complete, you can examine the ranges of objects in your model using the histograms in the Visualization of Simulation Data pane.

  3. Convert Data Types

    The Fixed-Point Tool proposes data types based on the ranges collected in stage two. You can edit the default word length and other proposal settings in the Settings menu. To generate proposals, click Propose Data Types. If you are satisfied with the proposals, click Apply Data Types.

  4. Verify New Settings

    Simulate your model using the newly applied fixed-point data types to examine the behavior of the fixed-point model. You can compare the floating point and fixed-point behavior using the Simulation Data Inspector.

After verification, if you determine that the behavior of the system is not acceptable, you can iterate through the conversion and verification steps until you settle on a design that satisfies your system requirements. For more information, see Explore Additional Data Types.

To begin the fixed-point conversion process, see Set Up the Model.

Related Topics

Was this topic helpful?