- Comparing different Fixed-Point Data Types using Fixed-Point tool
- Visualizing signals to explore data types using Fixed-Point Tool
Wrong conversion from double to fixed point
조회 수: 6 (최근 30일)
I'm trying to convert a project developed in double data type into a fixed point data type project, but I'm loosing to much precision.
Using the double data type my output speed is expressed in RPM, but using fixed point data type I need to have it as fixdt(1,16,15) using an input value (delta_angle) coming from the outside ad fixdt(1,16,12).
Please see the attached models.
Do you have any suggestion to convert properly the data?
Thanks in advance for the help.
MathWorks Fixed Point Team 2020년 1월 13일
Hello, you can try to use any of the Fixed-Point designer workflows to achieve this task.
Please find attached a script that uses the fixed-point optimziation feature to help with the conversion. With this workflow you only need to set the allowable level of error in your system requirements using the "addTolerance" API. With this information, fxpopt will try to convert your system automatically. Please notice that the attached model is the one I got running on my local PC (on a 19b version of MATLAB).
Alternativelly you can use the fixed-point tool to go though the steps of conversion manually.
You can find some introductory videos and exmaples on these links.
Using Fixed-Point Tool: