Is there any function of calculate fractional power in dsp_lib Topic is solved
Is there any function of calculate fractional power in dsp_lib
Hi I want to calculate the integer to the fraction power about fixed point number, like (10^0.1), but I don't find any function about this in dsp_lip. Anyone know?
View Solution
Would exp(log(10)*0.1) work for you?
AFAIK the dsp_lib doesn't have a function to do this directly. You can use dsp_math_exp and dsp_math_log if the errors are low enough to suit you and speed and input range are OK, using the identity a^b = e^(b ln(a)).
Oops sorry ahenshaw - didn't see your reply.
Oops sorry ahenshaw - didn't see your reply.
ahenshaw and CousinItt are correct however I would caution against using floating point maths because the xcore is a fixed point architecture.
This means that floating point maths is calculated using a software library and hence is very slow.
I would recommend using QFormat for your real-time code.
lib_dsp supports QFormat by default.
Best regards,
John
This means that floating point maths is calculated using a software library and hence is very slow.
I would recommend using QFormat for your real-time code.
lib_dsp supports QFormat by default.
Best regards,
John
Thanks very much for all