Isolating frequencies and phases of superposed cosine functions

real-analysistrigonometry

This problem is mathematical, but it is needed in physics. I have points on the graph of the function $y = f(x)$. These points were obtained experimentally. I have a lot of such graphs. The pictures below show only two examples. It is known that $f(x) = A_{1}\cos(w_{1}x + \phi_{1}) + A_{2}\cos(w_{2}x + \phi_{2})$, where $A_{1}, w_{1}, A_{2}, w_{2}, \phi_{1}, \phi_{2}$ are some constants (real parameters) and $w_{1} > 0, w_{2} > 0$. I need to determine the approximate values of numbers $A_{1}, w_{1}, A_{2}, w_{2}$ knowing what the graph of a function looks like. I want to know the values of numbers $A_{1}, w_{1}, A_{2}, w_{2}$ even with a large error, for example, with an error of 50%. I need to know this so that I can use a computer program OriginLab to analyze this graph.

My question. The graph of the function clearly shows where the extremum points are. You can see the values of the function at the extremum points. The points of intersection of the graph of the function with the abscissa axis are also clearly visible. Is it possible on the basis of this to find approximate (not exact) values of numbers $A_{1}, w_{1}, A_{2}, w_{2}$ ? I would like to know not only the method of how to do this, but I also want to know the mathematical proof of this method. It is about a method how to calculate these parameters on paper. This is not about numerical methods.

My work. At the moment, I do not know this method. On the Internet, you can find special cases of how this function looks, but I'm interested in the general case for arbitrary values of $A_{1}, w_{1}, A_{2}, w_{2}, \phi_{1}, \phi_{2}$. I tried to investigate the function myself using differentiation, but very complex transcendental equations are obtained.
enter image description here

Best Answer

First of all, discrete Fourier series do not really help here since these functions are not even periodic in general. Instead, the parameters can be recovered by using a linear recurrence. If you sample such a function on a fixed frequency then every five subsequent values satisfy a fixed linear relation. So take $$f(k) = A \cos(\omega_1 k + \varphi_1) + B \cos(\omega_2 k + \varphi_2)$$ for $k \in \mathbb Z$. Assume the generic case where $\cos(\omega_1) \neq \cos(\omega_2)$ and both unequal to $\pm 1$. Then there exist unique $c_1, c_2 \in \mathbb R$ such that $$f(k) + c_1 f(k+1) + c_2 f(k+2) + c_1 f(k+3) + f(k+4) = 0$$ for all $k\in \mathbb Z$. In particular these coefficients can be derived from any six subsequent values of $f$ by solving two linear equations in $c_1, c_2$. The characteristic polynomial for this recurrence factors as $$1 + c_1 x + c_2 x^2 + c_1 x^3 + x^4 = (x^2 - 2 \cos(\omega_1) x + 1)(x^2 - 2 \cos(\omega_2) x + 1).$$ This recovers $\cos(\omega_1)$ and $\cos(\omega_2)$ as solutions of the quadratic equation $$4x^2 + 2 c_1 x + c_2-2 = 0.$$ Now $f$ can be fitted as a linear combination of the four functions $$\cos(\omega_1 k), \sin(\omega_1 k), \cos(\omega_2 k), \sin(\omega_2 k)$$ noting that $$\cos(\omega k + \varphi) = \cos(\varphi) \cos(\omega k) - \sin(\varphi) \sin(\omega k).$$

Related Question