Piecewise polynomial fitting a sinusoid

58 Views Asked by At

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:

  1. Polynomials can have a maximum order of 4.
  2. Up to 16 polynomials can be used.
  3. The fit is to be continuous.
  4. The first and second derivative also need to be continuous.
  5. The error for the fit should be minimized, likewise, for the first and second order derivative.
  6. 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.

1

There are 1 best solutions below

0
On BEST ANSWER

I found a script which was able to fit on almost all criteria I had,

http://nl.mathworks.com/matlabcentral/fileexchange/13812-splinefit