Model-Based Design to Develop and Deploy a
Video Processing Application
02 Converting the Design from Floating Point to Fixed PointTo implement this system on a fixed-point processor, we need to convert the algorithm to use fixed-point data types. In a traditional design flow based on C programming, this conversion would require major code modification. Conversion of the Simulink model involves three basic steps:
Change the source block output data types. During automatic data type propagation, Simulink displays messages indicating the need to change block parameters to ensure data type consistency in the model.
Set the fixed-point attributes of the accumulators and product outputs using Simulink Fixed Point tools, such as Min-max and Overflow logging.
Examine blocks whose parameters are sensitive to the pixel values to ensure that these parameters are consistent with the input signal data type. (The interpretation of pixel values depends on the data type. For example, the maximum intensity of a pixel is denoted by a value of 1 in floating point and by a value of 255 in an unsigned 8-bit integer representation.)
This can be done using Fixed-Point Tool or by Fixed-Point Advisor from Tools->Fixed-Point
If this is first time, then start with Fixed-Point Advisor.
This opens a window as shown below:
The Fixed-Point Advisor is broken into four main tasks. Each task addresses one aspect of the conversion process. The tasks are:
After pressing the button "Run to Failure", tool will run till failure and then opens model advisor window as well as report like as below:
After doing the modification and changes need to run again.
Sometimes, to go directly to the error location we need to use "Explore Result…" Button as shown below.
This Floating-Point to Fixed-Point conversion is an iterative procedure; we need to run every time after doing small changes in the model. And finally here we go with Fixed-Point Model.