This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CMSIS DSP new functionality proposal

CMSIS DSP is a great tool which allows Cortex-M4 devices to have a great app field range, even replacing some general purpose DSP sometimes. However I am missing some "simple" new functions that could enhance, even more, the use of it.

For example:

- LOG approximation functions (float, int16, etc), which are one of the greatest time consumption methods in an Audio application.

- Vector Division, as Vector Multiplication (arm_mult_f32), quite handy.

- Threshold functions, something similar to the arm_max_f32 function. Comparing athreshold level and returning a vector with ones or zeroes if the original vector is bigger or smaller than the threshold level.

- Complex Phase calculation, same way as arm_cmplx_mag_f32 does for calculating the magnitude of an output FFT signal, but for getting the phase of two signals.

I am sure many other users have many more suggestions/ideas to extend the functionality of CMSIS DSP, which is the base of many great prodcuts/applications out there.

Please, take this as just a starting point, but from my point of view, I think this could be pretty interesting.

Regards.

  • Hi and thanks for the input regarding the CMSIS functions.  We'll keep these in mind as we discuss new features for upcoming releases of the library.

    If anyone else has suggestions for additional functions, please let us know!

  • Thank you for your answer pbeckmann

    I think it is great that you (as a company and as developers) are listening to the users of CMSIS DSP.

    I would propose some new functions:

    - Exponential functions, to complement the Logarithmics functions. Power of 2, 10 and e.

    - Complex vector constructors, same way as arm_copy does, but reading from two vectors, so the output is an interleaved stereo vector (L0 R0 L1 R1 L2 R2...Ln Rn)

    - Convolution

    - Decimation, similar way as interpolation works.

    - Autocorrelation

    - Compression algorithms as A-law, u-law, etc

    It would be also nice to get standard windowing functions, but anyway,  today is possible by multiplying two vectors.

    Best regards.

  • Hello Dr. Beckman.

    How is the upcoming release going? Will we see any of these changes included?

    Regards.

  • There is no near term update to the CMSIS library planned.  The earliest something would happen is mid next year.

    Note that the library already contains convolution, correlation, polyphase FIR interpolation and decimation.  Would these work for you?

  • Thank you Dr. Beckman.

    You are right, I forgot convolution is already there. We are already using FIR.

    However, I am missing LOG, Exponential, Thresholds, Phase calculation, Vector divisions and Complex vector constructors. I think these can save quite a processing time if implemented in CMSIS.

    Don't you agree?


    Actually I was asking about your view with this proposal.

    Regards.

  • Just a question about the additional functions.  The math.h library is already fairly well optimized.  It is possible to get a speed boost for functions like log() and exp() if you operate on a vector of values and if an approximation is OK.  Could you live with less precision than math.h or do you need full precision?  If you need full precision then you should stick with math.h.

  • Less precision is OK for me. I expected that.

    In fact, I am using some approximation functions for converting to log10f() values, but they work slower than on PCs. Probably architechture?

    Thank you pbeckmann

  • Re: @Dr. Paul Beckmann

    Good morning, pbeckmann

    Is there any update on the CMSIS version?

    Kindly Regards

  • Hi.  Unfortunately there haven't been any new functions added to the CMSIS DSP library.  If it helps, here is a bit of code from our Audio Weaver tools that does an approximation to log2() and can be easily used to compute log10().  This should give you some performance improvement in your immediate project.

    /* ----------------------------------------------------------------------

    ** Fast approximation to the log2() function.  It uses a two step

    ** process.  First, it decomposes the floating-point number into

    ** a fractional component F and an exponent E.  The fraction component

    ** is used in a polynomial approximation and then the exponent added

    ** to the result.  A 3rd order polynomial is used and the result

    ** when computing db20() is accurate to 7.984884e-003 dB.

    ** ------------------------------------------------------------------- */


    float log2f_approx_coeff[4] = {1.23149591368684f, -4.11852516267426f, 6.02197014179219f, -3.13396450166353f};


    float log2f_approx(float X)

    {

      float *C = &log2f_approx_coeff[0];

      float Y;

      float F;

      int E;

      // This is the approximation to log2()

      F = frexpf(fabsf(X), &E);

      //  Y = C[0]*F*F*F + C[1]*F*F + C[2]*F + C[3] + E;

      Y = *C++;

      Y *= F;

      Y += (*C++);

      Y *= F;

      Y += (*C++);

      Y *= F;

      Y += (*C++);

      Y += E;

      return(Y);

    }

  • Thank you pbeckmann ,

    this function is very useful to me.

    However, do you think any of the suggestions I made (exp funcions, vector division, Threshold vector or Compression functions) could be included in future releases? From my point of view, CMSIS-DSP is the tool needed for anyone who wants to switch from the DSP world to ARM.

    When is the next release date?

    Regards

  • Hi Paknucleo,

    The latest set of changes for the CMSIS DSP library were support for the M7.  We don't have plans this year to add more functions. We'll keep your suggestions in mind for future releases but nothing will happen in the near term.

    -Paul