manual fixed-凯发k8网页登录

main content

manual fixed-point conversion workflow

  1. implement your algorithm in matlab®.

  2. write a test file that calls your original matlab algorithm to validate the behavior of your algorithm.

    create a test file to validate that the algorithm works as expected in floating point before converting it to fixed point. use the same test file to propose fixed-point data types. after the conversion, use this test file to compare fixed-point results to the floating-point baseline.

  3. prepare algorithm for instrumentation.

  4. write an entry-point function.

    for instrumentation and code generation, it is convenient to have an entry-point function that calls the function to be converted to fixed point. you can cast the function inputs to different data types, and add calls to different variations of the algorithm for comparison. by using an entry-point function, you can run both fixed-point and floating-point variants of your algorithm. you can also run different variants of fixed-point. this approach allows you to iterate on your code more quickly to arrive at the optimal fixed-point design.

  5. build instrumented mex for original matlab algorithm.

  6. run your original matlab algorithm to log min/max data. view this data in the instrumentation report.

  7. separate data types from algorithm.

    convert functions to use types tables and update entry-point function.

  8. validate modified function.

    1. create fixed-point types table based on proposed data types.

    2. build mex function.

    3. run and compare mex function behavior against baseline.

  9. use proposed fixed-point data types.

    create fixed-point types table based on proposed data types, build mex, run, and then compare against baseline.

  10. optionally, if have a matlab coder™ license, generate code.

    start by testing native c-types.

  11. iterate, tune algorithm.

    for example, tune the algorithm to avoid overflow or eliminate bias.

网站地图