2

Given at least 3 points $(x_{i}, y_{i})$, how to confirm if all points lie on a sine wave? Or alternatively, how to determine the parameters of a sine wave that best fits the data (I'm guessing amplitude and phase would be sufficient?).

Context: I am processing images and attempting to identify sinusoidal features within a rock face programmatically. I'm able to identify these as well as other features using edge detection. I'm now trying to isolate the sinusoidal features. I have a number of ideas of how to do this, the above idea would likely be the least computationally intensive but I've no idea hoe to go about it.

Mike Jones
  • 29
  • 3
  • Welcome to Maths StackExchange. Please provide more context for your problem or include what you have tried so far to solve it. – Dean Miller Mar 18 '24 at 00:42

2 Answers2

1

Three points given

Here is a program for three points given on line3 solved by least squares method. Output signal tallies exactly with (goes through) the 3 given points.

Recently I was helped for this by Bill on Mathematica site.

enter image description here

EDIT !:

Another signal containing 3 input points with exact match:

$$(x1, y1, x2, y2, x3, y3)=(1., 0.4, 3., 1., 12., -2.); $$ $$(a,b,c)= (2.1450555574383996,-1.9070717143143807,2.094645060163228); $$ enter image description here

More than three points given

Note that if we give more than 3 points, a least square fit would be obtained in terms of the three coefficients using the same code.

Narasimham
  • 40,495
-3

The $3$ points if be ...

  1. (a, b)
  2. (c, d)
  3. (e, f)
    then ...
    $\sin a = b$ and $\sin c = d$ and $\sin e = f$ then the $3$ points are on a sine curve.

However, I haven't come across anyone/anything that clearly states the minimum number of points for a sine wave. For instance if you know a relationship is linear (a straight line), you need only find $2$ points. From what I know, a sine wave has to be periodic/cyclical and has to have a maximum and a minimum and a midline, the max & min equidistant from the midline.

  • 3
    No matter how many points you have, so long as they have different $x$ coordinates, there are infinitely many sine waves that pass through all of them. This is known as aliasing. If you have an upper bound on frequency, then at least for equally spaced points there's the Nyquist theorem, which says something about how many points suffice to completely determine a sine wave, if the sine wave has a frequency less than the Nyquist frequency (which comes from the point spacing). – Kyle Miller Mar 18 '24 at 02:20
  • @KyleMiller, interesting. I'm familiar with basic sinusoidal modeling (temperature, etc.). I suppose it's a matter of eyeballing it from perioidicity in the data. Most inatances I've seen have been ones that inferred a sinusoidal pattern from max & min and period and sometimes (cogito) the midline. Gracias muchas. – Agent Smith Mar 18 '24 at 02:39
  • 2
    @KyleMiller I'm not so sure this is true. Aliasing usually refers to duplication of spectrum components at multiples of the sampling frequency, I don't think it can be used to show that for a collection of points there exists a single sinusoid passing through all of them. For instance, if our points aren't equally spaced we don't even have such a sampling frequency to speak of, much less if the distances aren't rational multiples. I think ${(1,0),(2,0),(3,0),(\pi,0)}$ is an example of a set of points without any common sinusoid, but I may be mistaken. – Tom Mar 18 '24 at 05:34
  • @Tom Thanks, that's certainly an oversight — it should be that there are either zero or infinity solutions I believe. I don't mean to say that aliasing accounts for the existence of a solution, but rather that aliasing is the principle that there is not just a single sine wave that passes through some given points (these various sine waves are "aliases" of one another). – Kyle Miller Mar 18 '24 at 06:48