Formula of frequency modulated sine wave from data points I'm trying to determine the formula of a variable frequency sine wave based on the values of max1, max2, min1 and min2. y(0) isn't necessarily 0 and I can assume the frequency increases or decreases linearly (I only want to plot the first couple oscillations).



I've figured the formula for the non-modulated signal (based only on max1 and min1) as the following:

$y(x) = sin(2π*f*x + C)$ 
where
$f=\frac{1}{2\left(\max _1-\min _1\right)}$ 
and
$C = -\left(max_1-\frac{\left(max_1-min_1\right)}{2}\right)\cdot \frac{\pi }{\left(max_1-min_1\right)}$

I've also figured that plotting:  

$y(x) = sin(2π*(f+M(x))*x)$ where
$M(x)= a*x + b$  

results in an increasing frequency signal but I can't figure out the exact formula to have the wave match the data points.

Any help would be much appreciated, my math skills are rusty...
If your function is $y(x)=\sin(2\pi fx+C)$, and you have data points $\{x_i,y_i\}$, then finding $C$ is easy, if you suppose $x=0$ then $C=\arcsin(y(0))$.

Now, according to your plot your frequency varies with $x$. The first thing you need to do is to know how does your frequency vary with $x$. Supposedly this variation is linear, then you write: $f(x)=ax+b$ and your function model becomes $y(x)=\sin(2\pi f(x)x+C)$.

The problem now is finding (an estimate for) $f(x)$. You have two unknowns to determine $a$ and $b$, you need two data points ($\{x_1,y_1\}, \{x_2,y_2\}$) and you solve a system of two (nonlinear) equations with two unknowns.

$$\begin{cases}
y_1=\sin(2\pi (ax_1+b) x_1+C)\\
y_2=\sin(2\pi (ax_2+b) x_2+C)
\end{cases}$$