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.

IQMath FOr floating point DSC's?

Other Parts Discussed in Thread: CONTROLSUITE

Hi,

According to IQMath reference guide,it is used port the floating point alogorithms into fixed point devices.

For native floating point devices,it is not necessary. Am i right ?

I am using F28335.which is a 32-bit native floating point device. IQMath is not used for this ?

give me the solution ?

 

Thanks & Regards,

Naveen Rangu.

  • Naveen Rangu said:

    According to IQMath reference guide,it is used port the floating point alogorithms into fixed point devices.

    For native floating point devices,it is not necessary. Am i right ?

    I am using F28335.which is a 32-bit native floating point device. IQMath is not used for this ?

    give me the solution ?

    Using the IQmath syntax can make it easier to go the other way as well. If you think at some point you  may want to move to a fixed-point processor, then consider writing your floating-point code using the IQmath syntax.   In this case you would start with the MATH_TYPE defined as FLOAT_MATH and generate native floating-point code.  Later you can change the MATH_TYPE to to IQ_MATH and test using IQmath on on a fixed-point device. 

    The choice is yours.

    Regards

    Lori

  •  

    If you think at some point you  may want to move to a fixed-point processor, then consider writing your floating-point code using the IQmath syntax.  

     

    Thanks Lori,

    I am devolping an application using only native floating point processor (F28335) , i wont move to fixed point processor at any point. and i am not clear your statement that some point you may want to move fixed point processor (in what sense?) ..So  can i write the code without using IQmath ?

    without IQmath will it work perfectly ?

    Regards,

    Naveen Rangu

     

  • Correct, you don't have to use IQMath. It's just a nice feature if you decide you want to run as fixed point and see what floating point really buys you. Some customers do development in floating point then migrate to the pin-pin fixed point device to save a little cost.

  • Thank you Chris...

    Now i understood.....

     

    Regards,

    Naveen Rangu

  • ChrisClearman said:

    Correct, you don't have to use IQMath. It's just a nice feature if you decide you want to run as fixed point and see what floating point really buys you. Some customers do development in floating point then migrate to the pin-pin fixed point device to save a little cost.

     

    Hi, ChrisClearman

    You also answer the question that I worry about for long time. thank you

     I suggest that in IQMath User Guide, you should notably indicate e.g. "for native floating point DSP, sin() plays exactly the same effect as IQSin()". You know, some customers of TI are students, who rarely care about the cost and the portability.

    By the way, the floating point algorithm (e.g. sin() ) is supported by which library, rts2800_fpu32_fast_supplement.lib or rts2800_fpu32.lib ?? Or somthing else?

    Best wishes!

    Qian

  • Qian,

    I need to clarify and correct one thing, the IQsin is an optimized version of Sin, where the normal sin from <math.h> header file woudl use a sin function that is full C/C++ definition, however this comes at an extensive cycle cost. For control applications where control loops run at 10's -  100's of Khz. this is prohibitive. Thus the IQsin provides optimized routines for these functions.

    Also some of the routines such as sat etc.. would use the maximum of the DSP instruction set. As not all the DSP instructions can be used by the compiler directly because of C/C++ definition.

    The rtslib is the run time support library that supports various C header files including math.h. When the fast rtslib is included the compiler would use the faster but slightly compromised version of the sin value function. The resolution that we get from these sin functions is good for most control application and has been used by us for years for motor control etc.

    regards

    Manish Bhardwaj

     

  • Manish Bhardwaj said:

    Qian,

    I need to clarify and correct one thing, the IQsin is an optimized version of Sin, where the normal sin from <math.h> header file woudl use a sin function that is full C/C++ definition, however this comes at an extensive cycle cost. For control applications where control loops run at 10's -  100's of Khz. this is prohibitive. Thus the IQsin provides optimized routines for these functions.

    Also some of the routines such as sat etc.. would use the maximum of the DSP instruction set. As not all the DSP instructions can be used by the compiler directly because of C/C++ definition.

    The rtslib is the run time support library that supports various C header files including math.h. When the fast rtslib is included the compiler would use the faster but slightly compromised version of the sin value function. The resolution that we get from these sin functions is good for most control application and has been used by us for years for motor control etc.

    regards

    Manish Bhardwaj

     

     

    Hi, Manish

    I am confused again now. Let's make a simpler statement.

    If

    1.Call mathematic functions in IQ format

    2.MATH_TYPE defined as FLOAT_MATH

    3.Link fast_rtslib before rtslib

    Then the F28335 can achieve the best calculation performance.

    Is it true?

    Thanks!

    Qian

     

  • Yes this is true,

     

  • What about the fastRTS Library in controlSUITE? is this one faster than the IQmath method pointed before? according to the benchmarch it appears so:

    sin 37 cyles, cos 38 cycles, sincon 44 cycles. The IQMath according to SPRC990 v1.5 june 2010 its: IQNSinPU 40 cycles, IQNCosPU 3 cycles.

    Thanks,

     

    Maziel

     

  • Maziel Velasquez said:

    What about the fastRTS Library in controlSUITE? is this one faster than the IQmath method pointed before? according to the benchmarch it appears so:

    sin 37 cyles, cos 38 cycles, sincon 44 cycles. The IQMath according to SPRC990 v1.5 june 2010 its: IQNSinPU 40 cycles, IQNCosPU 3 cycles.

    Thanks,

     

    Maziel

     

    Yes, fastRTS is written in native floating point and is faster than IQmath which is "virtual floating point" (ie written for a fixed point device).    If you use IQmath syntax and then change your math type to float, but link the fastRTS in before the normal RTS, then you will get those benchmark numbers.

    This wiki article goes into some more detail about switching to float and using fastRTS:

    http://processors.wiki.ti.com/index.php/IQmath_Library_for_C28x

    -Lori

     

    -Lori