2022-11-25 11:16 AM
I try to use "arm_math.h", but I can't find any function about logarithmic operation in "arm_math.h". Is there none logarithmic in this, or am I not found?
2022-11-25 11:19 AM
Do I have to use the traditional "math.h" to calculate the logarithm ? I'm worried that "math.h" will count slowly.:sad_but_relieved_face:
2022-11-25 01:21 PM
who knows...did you test real speed ?
+
https://arm-software.github.io/CMSIS_5/DSP/html/group__vlog.html
2022-11-26 02:45 AM
No,I haven't tested it. It would definitely be slower in theory, because FPU will only optimize float-type variables, whereas traditional logarithmic algorithm are based on "double".
+
Super thanks! I think that's what I'm looking for!😍
2022-11-26 03:25 AM
I feel like I've found the logarithmic operation function:backhand_index_pointing_down:？But.....how to use？What does the third parameter(blockSize) mean:astonished_face: ?
void arm_vlog_f16(const float16_t * pSrc,float16_t * pDst,uint32_t blockSize )
2022-11-26 03:40 AM
use: search, read, learn - how to load/include cmsis lib.
vector - seem is to convert an array in -> out , as needed for fft output
2022-11-26 03:47 AM
> traditional logarithmic algorithm are based on "double"
Have you looked at C documentation, which is newer than 23 years old?
https://en.cppreference.com/w/c/numeric/math/log
> What does the third parameter(blockSize) mean:astonished_face: ?
Vector means an array. DSP is not some magic, which can turn everything magically faster. The speed is mainly gained by using a SIMD style instructions and parallel calculation. For a calculation of a single number the vectored functions will probably be slower than the appropriate standard C functions.
2022-11-26 09:15 AM
Thank you so much:* ! What you said was very thorough and clear👍. I didn't find out that "Vector" means "array" before, which led to a misunderstanding.:face_with_medical_mask:
2022-11-26 09:19 AM
Yes, I just tested it, and "vector" does mean "array"! After understanding this, "blockSize" is very clear---number of samples in each array😂
2022-11-26 10:12 AM
So to sum up how to use a (single) float numbers... Use the standard C functions with "f" suffix like logf() and add "f" suffix to constants like 1.618f. Also I would recommend compiling with -Wdouble-promotion for GCC and, if available, a similar option for other compilers.