Fitting a sine curve that isn't a perfect sine curve?

  • Context: Undergrad 
  • Thread starter Thread starter Phystudent91
  • Start date Start date
  • Tags Tags
    Curve Fitting Sine
Click For Summary
SUMMARY

The discussion focuses on fitting a sine curve to data exhibiting sine-like properties but with irregular peak-to-peak distances. The user attempted to use SciDAVis for curve fitting but found it only provided an average sine curve. Recommendations include using a model function of the form f(x) = a*sin(x*g(x)), where g(x) is a linear function, and employing Fast Fourier Transform (FFT) for data spanning multiple periods. Non-linear regression techniques and specific algorithms for sinusoidal fitting are also suggested, along with the use of the "function finder" tool available at zunzun.com for trigonometric equations.

PREREQUISITES
  • Understanding of sine wave properties and characteristics
  • Familiarity with non-linear regression techniques
  • Knowledge of Fast Fourier Transform (FFT) applications
  • Basic experience with SciDAVis for data plotting
NEXT STEPS
  • Research non-linear regression methods for sine wave fitting
  • Explore Fast Fourier Transform (FFT) for analyzing periodic data
  • Utilize the "function finder" tool on zunzun.com for trigonometric fitting
  • Investigate algorithms for sinusoidal fitting as outlined in "Régressions et équations intégrales"
USEFUL FOR

Students and researchers in physics or engineering, data analysts working with periodic data, and anyone involved in curve fitting and analysis of interference patterns.

Phystudent91
Messages
6
Reaction score
0
For my 3rd year project, I have a set of data which is the variation within an interference pattern.
The outcome has clear sine curve properties (Alternating peaks and troughs of intensity) but the positions aren't regular (i.e. the peak-to-peak distance between peak1 and peak2 is larger than the distance between peak2 and peak3).

I have tried using SciDAVis to plot this curve but it finds a best-fit/average kind of sine curve, not a fit that passes through all the available points. Is there a method or program that will help me?

I would preferably be able to make a note of the equation of the curve in order to plot it with other sine curves of the interference pattern from other varying distances from the sources.
 
Physics news on Phys.org
I'm not sure what the program you're using is, but if your specified model function is a sine wave then it won't be able to account for the frequency variation you describe. Can you find any simple relationships between the peak-to-peak distances? The model function might take the form f(x) = a*sin(x*g(x)), where g(x) can be some linear function in x, say, g(x) = bx + c.
 
If your data extends over a number of periods, try Fast Fourier Transform (FFT).
If the data extends over only a narow range (a few periods or only a part of a period) and if the expected function patern is y=a*sin(w*x+b)+c, you may try a non-linear regression in order to compute w, a, b, c. This is a difficult problem. The methods are rarely reliable, depending a lot of the data (number, distribution, scatter). Generally, they use some iterative algorithm :
http://mathworld.wolfram.com/NonlinearLeastSquaresFitting.html
A especially non-iterative algorithm for the sinusoidal case is presented in pages 35, 36 of the paper " Régressions et équations intégrales" :
http://www.scribd.com/JJacquelin/documents
 
Last edited:
What you are trying to fit is probably not enough of a sine wave to fit it like that. What you could do, if the fft doesn't work, is trying to extract the phase \phi(t) and then fit a linear (polynomial) function through it for example. The most simple way to do it, is taking the average value of the function, define it as zero and find the zero crossings. These points represent a phase of \pi,2\pi,3\pi,\dots. You could also do this with the maxima and minima. It is a bit of a hack, but you might get some useful information.
 
Phystudent91 said:
Is there a method or program that will help me?

You can try the "function finder" on my curve and surface fitting web site, http://zunzun.com - it is free and won't cost anything to give it a try. You can limit the function finder to trigonometric equations only. The direct link is:


http://zunzun.com/FunctionFinder/2/

If you need any help with the site, contact me directly:

James Phillips
Personal Info deleted

web: http://zunzun.com

James
 
Last edited by a moderator:

Similar threads

  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 9 ·
Replies
9
Views
4K
Replies
2
Views
1K
  • · Replies 4 ·
Replies
4
Views
22K
  • · Replies 9 ·
Replies
9
Views
7K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
Replies
2
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K