|
From: | Dmitri A. Sergatskov |
Subject: | Re: non-linear regression |
Date: | Wed, 25 Feb 2004 09:37:32 -0700 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040115 |
Al Niessner wrote:
I am trying to fit a sine wave (A*sin(b*x+C) +D) to a set of data -- least square. Is there an existing function in octave to help with this. I checked the documentation (online) and browsed the 'octave> help' but nothing jumped out at me.
I had to do it some time ago. The signal consisted of few sharp lines So I did fft first to find the frequencies f(n) and then did OLS fit to A(n)*sin(2*pi*f(n)*t(i)) + B(n)*cos(2*pi*f(n)*t(i)) + D Sum by n; t(i) is time vector. That worked very well, but max n was something like 4. Sincerely, Dmitri. ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------
[Prev in Thread] | Current Thread | [Next in Thread] |