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. 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 += 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