Question, I have a sinusoid which I have to resemble as perfect as possible using piecewise polynomials in the domain 0..2pi.
Unfortunately there are some constraints:
- Polynomials can have a maximum order of 4.
- Up to 16 polynomials can be used.
- The fit is to be continuous.
- The first and second derivative also need to be continuous.
- The error for the fit should be minimized, likewise, for the first and second order derivative.
- The error in the frequency content should also be minimized. (This is actually the most important criteria)
What I would like to see: ideas on how to achieve this, applied or advanced literature or an actual implementation, for instance in Matlab.
I found a script which was able to fit on almost all criteria I had,
http://nl.mathworks.com/matlabcentral/fileexchange/13812-splinefit