Make it to the Right and Larger Audience


Floating to Fixed Point C Conversion Tool


IP : zip, 8.75 KB

Product Description

Floating point to fixed point conversion is commonly met in signal processing and wireless system design. Most of time, initial algorithm is in floating point. When it is time to implement using hardware like ASIC or FPGA or using software method but on fixed point DSP, we need to convert floating point algorithm to fixed point. Matlab/Simulink can be used to achieve this but the speed is a big concern when algorithm is complicated and tool cost is also another concern.

This C based fixed point library is ideal in this case. It is fast, has no additional cost (using just g++ to compile) , is easy to understand (if you know C++ well 🙂 ),  to the point, and supports both real and complex number.

Here are some sample codes.

fixp.h (963 lines)

Here is the file list:

  1. common.h defines some common variables
  2. fixp.cpp real number fixed point cpp
  3. fixp.h real number fixed point h file
  4. fixpcomp.cpp complex number fixed point cpp
  5. fixpcomp.h complex number fixed point h file
  6. tst1.c test file for real number case
  7. tst2.c test file for complex number case
  8. makefile makefile
  9. design_notes notes and issues met of how to use C++ to write this lib

Here is some result:

It shows variable d’s floating result is 12.9729 but due to fixed point conversion, it becomes 12.9375.

It also includes a very valuable note about how to use C++. Some samples:

If you want to understand and start your system design with c-based fixed point conversion in real world, this is ideal for you!


Only logged in customers who have purchased this product may leave a review.

Got something to discuss?


Interesting. I have been using matlab fixedpoint blockbox for my graduate project. This C++ library sounds a very good solution.


Contact Us

Thanks for helping us better serve the community. You can make a suggestion, report a bug, a misconduct, or any other issue. We'll get back to you using your private message ASAP.



Forgot your details?