Replies: 3 comments 1 reply
-
It was getting the most precise results and I was never running into performance problems. |
Beta Was this translation helpful? Give feedback.
1 reply
-
It would be interesting to do some performance comparisions on different processors. I think I remember that floating points were faster on the ESP32. This might be interesting https://github.com/pschatzmann/arduino-audio-tools/wiki/Filters |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
arduino-audio-tools/src/AudioTools/VolumeStream.h
Lines 279 to 288 in af3e2c5
(factorForChannel() returns a float.)
Currently, volume is applied by using floats.
https://forums.raspberrypi.com/viewtopic.php?t=308794#p1848263
According to this benchmark, RP2040 can do around 1,5 million floating point operations and 5,7 million fixed point operations per second.
There could be a significant performance increase by switching to fixed point multiplication here. I think the user should set the volume as a float (for convenience) and this library should convert it to fixed point.
I plan to further look into this and maybe implement it. Unless you want to do it. Or is there a reason why fixed point math should not be used? If fixed point leads to worse performance on MCUs with an FPU, there could be a #DEFINE to switch between float or fixed point.
As comparison, ESP8266Audio uses fixed point math:
https://github.com/earlephilhower/ESP8266Audio/blob/0abcf71012f6128d52a6bcd155ed1404d6cc6dcd/src/AudioOutput.h#L67C1-L72C6
Beta Was this translation helpful? Give feedback.
All reactions