3 points on "horizontal" sinusoid, what is its period?

93 Views Asked by At

Imagine you have 3 points that are all a distance of 1 separated from each other. How do you find the sinusoid that goes through these 3 points if you also know that the sinusoid is not at a strange angle: it's a horizontal one: so you have the three red dots and you want to find the black sinusoid's period:

enter image description here

Is it correct that there is only 1 unique "horizontal" sinusoid that passes through these 3 points?

3

There are 3 best solutions below

0
On BEST ANSWER

Assuming that your sinusoid has zero mean, and that the points are equally spaced in the "time" coordinate, then

$$\begin{array}{rcl} x(t)&=& a \, \sin(b \, t +c)\\ x(t+h)&=& a \, \sin(b \, t +c + b \,h )\\ x(t-h)&=& a \, \sin(b \, t +c-b\,h) \end{array} $$

But $\sin(u+v) + \sin(u-v)=2 \sin u \cos v$. Hence

$$x(t+h)+x(t-h) = 2\, a \sin(b\,t +c) \cos (b\,h)= 2 \, x(t) \cos(b\,h)$$

Or

$$ b= \frac{1}{h} \cos^{-1}\left(\frac{x(t+h)+x(t-h)}{2 \, x(t)}\right) \tag{1}$$

This gives you the period as $T=2\pi /b$

Of course, you have more than one solution ("aliasing"), normally you are interested in the lowest frequency solution - which corresponds to the principal value of the arccosine function.

Note also that this is highly sensitive to measurement/numerical noise -specially if $x(t)\approx 0$, you probably don't want to do this if your data is noisy.

Added: This derivation (and the fact that three points should suffice) can be seen as a discrete analogous of the continuous case. If $x_t$ is a sinusoid then $\ddot{x}_t= -\omega^2 x_t$ ; replacing the second derivative by the discrete difference $(x_{t+h}-2 x_t +x_{t-h})/h^{2}$we get

$$ {(\omega \, h)^2} = -\frac{x_{t+h}-2 x_t +x_{t-h}}{x_t} \tag{2}$$

The relation of this equation with $(1)$ can be seen by writing that as

$$b\, h= \cos^{-1}\left(1+\frac{x(t+h)-2x(t)+x(t-h)}{2 \, x(t)}\right)\approx \sqrt{-\frac{x(t+h)-2x(t)+x(t-h)}{ \, x(t)}}$$ where we have used $\cos^{-1}(1-x^2/2) \approx x$ for small $x$.

0
On

A sinusoid can be written as the following general equation:

$$y = a\sin (bx + c)+d$$ This gives us four parameters. You have three data points. This would be an issue. However, we could make some assumptions. The first assumption is that there is no vertical offset, i.e. that the max and min of the sine wave are equal in magnitude, so $d=0$. This would give us three parameters for three unknowns:

$$y = a\sin(bx+c).$$

We could also argue that there is no phase shift, i.e. that $c= k\frac{\pi}{2}$ for some integer $k$. This is not necessarily zero because phase shifting by $k\frac{\pi}{2}$ turns sine waves into cosine waves, of course, and the choice of $\sin$ vs $\cos$ is entirely arbitrary.

However, from your plot it seems that the first approach is better. So we must simply solve:

$$\begin{align*} y_1 &= a\sin(bx_1 + c), \\ y_2 &= a\sin(bx_2 + c), \\ y_3 &= a\sin(bx_3 + c), \end{align*}$$ for the parameters $a,b,c$. The solutions will obviously only be unique modulo $\pi$ for $c$, and we might want to constrain $a > 0$ to make the solutions for $c$ unique modulo $2\pi$ instead. Nevertheless, constraining $c \in [0,2\pi)$ won't even really help you, anyway. It should be evident that there are probably infinitely many solutions for the frequency parameter $b$: you can fit infinitely many peaks between any two points.

0
On

Is the answer unique? No. Remember that $\sin( f x + b ) = \sin( fx + b + k2\pi)$, $k\in\mathbb{Z}$, so there are infinitely many solutions.

As to how to find one of these solutions, this is the first thing I would try:

$$ \phi(f,b) = \sum_i \vert y_i - \sin( f x_i + b ) \vert^2, $$

$$ \min_{f,b} \phi(f,b) \;\;\; \mathrm{s.t.} \;\;\; 0 \leq b \leq 2\pi. $$