I need to write MATLAB program (or use an existing one) to obtain Fourier series coefficients. Let's say the series is going to approximate a 1D curve. The boundary conditions are:

  • value of the curve's function in a few places
  • curve's first derivative known in a few places
  • maximum allowed value of curve's second derivative
  • number of harmonics
  • the value of curve's integral over a specified interval should be as big as possible <- optimization criterion.

All the functions and tools I've seen so far can obtain series coefficients in much more simple cases. Any hints will be helpful, especially:

  • literature, articles with descriptions of useful methods
  • hints on objective functions useful for Fourier Series
  • info on useful MATLAB Tools
  • $\begingroup$ It seems the same question asked here. $\endgroup$
    – Stefano M
    Aug 9 '12 at 13:09
  • 1
    $\begingroup$ @Jann - You might have better luck on here explaining how you are formulating your optimization problem and asking for specific advice on each bit. I don't know of a general-purpose MATLAB tool that will solve this problem for you. $\endgroup$ Aug 10 '12 at 13:35

Write your function as a linear combination of harmonics and treat the coefficients as variables. This gives a semi-infinite linear program. The Matlab optimization toolbox has a routine linprog to solve linear programs (LPs) only; so you need to discretize the curvature constraint.

Replace the curvature constraint by $N$ constraints evaluated at $N$ equidistant points, solve the LP, add more points close to the points where near-worst case curvature occurred, and repeat until the desired accuracy is reached.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.