Optimized function for array multiplication

Lesept

Member
Hi
Is there an optimized function for the element-wise multiplication of 2 arrays (dot product)?
The ESP32 provides one: ESP32 optimized dot product. I guess this kind of function os used in Audio processing applications.

More generally, is there somewhere an extensive description of the Teensy-specific API?
For example, I was looking for the checkStaticMemory() function (seen here) but couldn't find how to use it.

Thanks for your help.
 
The Teensy is an ARM based product, a quick search on this board indicates that the the ARM CMSIS DSP libraries should be available for you to use.
Within those it looks like something like arm_dot_prod_f32 would do what you want assuming you are using floats. There are equivalent versions for other data types.
 
PJRC Audio library makes extensive use of some ARM DSP for processing twin 16bit data sets in 32bit words. Not sure of the nature of those operations - but as @AndyA notes - it is worth looking into.
 
Searching for arm_dot_prod_q7 shows it does indeed exist. In CMSIS the floating-point and fixed-point types are indicated by f16, f32, f64, q31, q15, q7 in the function name...

But check the documentation, you might not be wanting fixed-point. Still you can look at the code for these to get tips about what optimizes well for ARM architectures.
 
Searching for arm_dot_prod_q7 shows it does indeed exist. In CMSIS the floating-point and fixed-point types are indicated by f16, f32, f64, q31, q15, q7 in the function name...
Thanks, I guess that they mean:
  • f16: float 16 bits
  • f32: float 32 bits
  • f64: float 64 bits
  • q31: signed int 64 bits ?
  • q15: signed int 32 bits ?
  • q7: signed int 8 bits ?
Am I correct?
 
  • f16: float 16 bits
  • f32: float 32 bits (float)
  • f64: float 64 bits (double)
  • q31: int32_t
  • q15: int16_t
  • q7: int8_t
 
Back
Top