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

AI Thread Summary
The discussion focuses on fitting a sine curve to data exhibiting sine-like properties but with irregular peak-to-peak distances. Users suggest that standard sine wave models may not suffice due to the frequency variation, recommending alternative approaches such as using a modified function form or employing Fast Fourier Transform (FFT) for broader data sets. For narrower data ranges, non-linear regression techniques are advised to compute parameters like amplitude and phase. A practical resource mentioned is the "function finder" on zunzun.com, which allows for trigonometric equation fitting. Overall, the challenge lies in the complexity of the data, requiring tailored fitting methods.
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.
 
Mathematics 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:
Thread 'Video on imaginary numbers and some queries'
Hi, I was watching the following video. I found some points confusing. Could you please help me to understand the gaps? Thanks, in advance! Question 1: Around 4:22, the video says the following. So for those mathematicians, negative numbers didn't exist. You could subtract, that is find the difference between two positive quantities, but you couldn't have a negative answer or negative coefficients. Mathematicians were so averse to negative numbers that there was no single quadratic...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Suppose ,instead of the usual x,y coordinate system with an I basis vector along the x -axis and a corresponding j basis vector along the y-axis we instead have a different pair of basis vectors ,call them e and f along their respective axes. I have seen that this is an important subject in maths My question is what physical applications does such a model apply to? I am asking here because I have devoted quite a lot of time in the past to understanding convectors and the dual...
Back
Top