This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to do floating point trignometric functions, log etc as well as floating point DSP functions like FFT, Filtering etc on C64+ Fixed Point DSP?

We would like to know how to do floating point trignometric functions, log etc as well as floating point DSP functions like FFT, Filtering etc on  C64+ Fixed Point DSP?

It is possible to directly use float variable in code and call these funciton, like for example

float x;

float y;

float z;

y = sin(x)

z = 10*log(x)

and similarly other funcitons sqrt, square etc also possible. Also it is possible to call DSP related floating point functions on C64+ fixed point DSP directly? Thanks.

  • Hi,

    Thanks for your post.

    sprc900, sprc265 and sprc121 are all DSP libraries  which are optimized for specific DSP architecture.

    • sprc900 is  floating point DSP software libraries that can be used on any C674x and later platforms.
    • sprc265 is a fixed point DSP software library that can be used on C64+ platforms and later platforms

    The library that is most suited to your application will depend on the nature of your application requirement. For Eg If you have to compute a 16 bit fixed point FFT , you should use the sprc265 library but if you have to compute a single precision floating point FFT then you should use the sprc900 library.

    The sprc121 is floating point DSP library for a device that is part of the C67x family (Eg C6726, C6701, etc). Here if you want to use a floating point DSP functions  then you should use sprc121 instead of the sprc900.

    MATHLIB contains optimized versions of most floating-point math routines currently provided in existing run-time-support libraries.

    MATHLIB RTS override library contains floating-point math routines with same symbol names as in run-time-support library. These routines can be used to replace existing run-time-support library function calls.

    The regular Mathlib library contains function names different from RTS library. For examples, sin() function in RTS is named sindp() in Mathlib. There are also sindp_v, sindp_i, sindp_c for vector, inline and C version in Mathlib.

    In Mathlib override library, the function names are the same as RTS library. sindp is not part of the RTS override library.

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    -------------------------------------------------------------------------------------------------------

  • hsg ken said:

    <snip>

    It is possible to directly use float variable in code and call these funciton, like for example

    float x;

    float y;

    float z;

    y = sin(x)

    z = 10*log(x)

    and similarly other funcitons sqrt, square etc also possible.

    <snip>

    Yes, it is possible.  Using TI's IDE (Code Composer Studio) with TI's C/C++ compiler (CGT), you will have access to the data types and functions you are familiar with from the C standard library.  Similarly true using other tool chains (e.g. gcc).  Programs so written will run correctly on both the fixed point and floating point processors.  However when they run, since a fixed point processor doesn't have the hardware to directly deal with the floating point calculations, those calculations will be emulated in software.  This will result in slower performance.  Depending on the use, the performance may still be fine.

    Once you determine you need faster performance, TI provides some software libraries that may help.  FastRTS can be used to increase the performance of basic floating point operations (e.g. floating addition) on their fixed point processors.  I don't think it has support for the full range of things found in the C standard library (e.g. no trigonometric functions).

    For the places where FastRTS isn't helping you, and where integer math doesn't cut it, you can consider using fixed-point math.  TI provides their IQMath library to help ease writing code using fixed-point math.  Moving to fixed point math will require you to move some of your code away from the familiar "float" world of C.

  • Thanks for the quick response...will try and get back if any more queries...