I have a signal (a time-series of air temperature values) that I can approximate quite well with a Fourier series. However, the number of terms in the series grows rapidly, to the point that 30 - 40 terms are needed for a good fitting.

So I was trying to understand how can I select only the Fourier series coefficients that convey the most information about the signal, and discard the others.

I could simply choose values of the series parameters a and b above a certain threshold value, but I do think this is not the right way to go.

I need to limit the number of terms because this approximate function will later be used for further elaborations, and the function must be input manually in the code (suggestions on how this task can be automated would be appreciated too).

I am not trying to predict future temperature or anything like that, I just need a function that can reproduce temperature oscillations with minimum period of ~12 hours.


1 Answer 1


Your inclination to choose the largest magnitude coeffecients is the correct one. There is a Linear Algebra explanation for this having to do with orthogonaility.

However, your second question is more pertinent, I think. If your sole motivation for reducing the coefficient count is to reduce data entry effort then you are much better off formatting the output of your DFT analysis as syntax for inputting into your code. Then a simple copy and paste will do the job for you. You also greatly reduce your exposure to data entry errors. Depending on the volume, a custom programming solution which automates the copy and paste process might be economical.

Hope this helps.


  • $\begingroup$ Ah, I wouldn't have dared thinking I was right. I think I should rather take the parameters with highest power as in sqrt(A^2 + B^2), Regarding the data entry effort, I plan to do this Fourier analysis for at least 12 months, each one very likely requiring a different number of parameters. So the effort may be considerable. $\endgroup$ Mar 12, 2018 at 13:27
  • $\begingroup$ @Fabio Capezzuoli, your a and b coefficients I presume to be for the cos and sin terms at a given frequency. These are still orthogonal. However, the problem is more complicated by understanding which is more important to preserve, trends or fluctuations. If you like, send me an email to cedron at exede dot net and I can elaborate further. $\endgroup$ Mar 12, 2018 at 13:58

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.