ARM-software / CMSIS-DSP

CMSIS-DSP embedded compute library for Cortex-M and Cortex-A
https://arm-software.github.io/CMSIS-DSP
Apache License 2.0
503 stars 131 forks source link

Weighted sum method appears to be doing a weighted average operation #198

Closed EdanSneh closed 1 month ago

EdanSneh commented 1 month ago

I was looking at the code for weighted sum and it appears to be doing a weighted average operation. Seems to be dividing by the sum of the weights at the end.

Weighted average: https://www.cuemath.com/data/weighted-average/ Weighted sum: https://www.slideshare.net/slideshow/weighted-sum-method-an-introduction/157822124#2

https://github.com/ARM-software/CMSIS-DSP/blob/main/Source/SupportFunctions/arm_weighted_sum_f16.c#L68-L110

Please double check my work.

christophe0606 commented 1 month ago

@EdanSneh It is indeed a weighted average. So the name of the function (and the documentation) are not correct.

christophe0606 commented 1 month ago

Corrected in latest commit. I renamed the function

EdanSneh commented 1 month ago

thank you!