GNU Scientific Library vs CMSIS Library Time and Space complexity

Hello,

         I have been using CMSIS library for implementation of DSP functions in ARM, however, CMSIS have very limited DSP functions. Although GNU has many DSP functions which CMSIS do not, It only have floating point implementation. I am trying to do DWT/ SWT in ARM Cortex M4, CC3200 TI Launchpad. Can anyone suggest me, how can I use GSL efficiently?

  • I'm assuming you don't have floating point on your specific M4 (some do) or you don't want to use floating point.  You can take the code from GSL and replace float with q31_t.  Then the fun part begins.  Now you have to scale your inputs and outputs to work within the Q31 range [-1,1) or  [0x80000000,0x7FFFFFFF].  After that, you need to go through the code and look for additions and multiplications and decide what kind of protection against overflow you might need to employ.  For example q31_t a,b,c;  c = a + b;  this could overflow, so you need to either choose a larger data type for c, saturate the addition with __SSAT or QADD, downshift the result, or downshift a&b

    Depending on the amount of code in the DWT function, this can be time consuming and error-prone.  I'd recommend making a unit test to make sure you don't mess up the accuracy of the DWT.

    Happy coding