Don't have access to AS7 for a while so I can't do the simple "try it and see if it works". I need to implement a DSP filter for 3 axes of accelerometer data. The starting point for the filter coefficients is:
X = 256 * exp( -2 * PI * Fcorner )
The resulting value is a run-time constant so it would be really nice to be able to do something like:
#define FCORNER 0.01 //corner frequency in Hertz #define PI 3.1415 #define XFIL 256*exp(-2*PI*FCORNER)
BUT, I suspect that exp() is only available via AVR-libc and so is not available to the preprocessor. I can always just do
#define XFIL 35 //coefficient for 0.01Hz corner
So, the question is whether or not the preprocessor is capable doing the computation in the first example, or is it necessary to resort to the second one?
Thanks for your help!