I'm trying to write an accelerometer calibration script that uses filters to convert from volts into $m/s^2$. As accelerometers tend to have non-flat response curves, this means I have to design a rather complex filter. I'm not worried about phase, as I can just apply the filter twice in opposing directions to correct for any phase offsets (like matlab's filtfilt
), so the focus is on designing a filter that approximates a user-provided magnitude curve.
Ideally, the user provides a calibration curve as input into an analytic algorithm to solve for the best fitting filter poles.
I'm aware MATLAB has a filter design function, but I don't know what the underlying algorithm is (if its an optimizer, or a closed form solution).
So my question is...
- Is there an analytic solution to my filter design problem? Or do I have to use optimisation scripts to get the best filter?
I'm not mentioning programming language here, as I want to understand the underlying math behind this.
filtfilt
approach to applying my filter, this would not be a concern for me, and it would result in a more accurately matched spectrum magnitude. If you post this as an answer (and i verify it works as expected), I'll accept it. $\endgroup$