help-octave
[Top][All Lists]

## Re: non-linear regression

 From: Joe Koski Subject: Re: non-linear regression Date: Wed, 25 Feb 2004 12:26:29 -0700 User-agent: Microsoft-Entourage/10.1.4.030702.0

```on 2/25/04 9:37 AM, Dmitri A. Sergatskov at address@hidden wrote:

> 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.

An alternative to classic the fft analysis approach for estimating
amplitude, A, and time-varying frequency of a signal would be Empirical Mode
Decomposition. It is briefly discussed at

http://www.owlnet.rice.edu/~elec301/Projects02/empiricalMode/index.html

and some .m scripts are available at

http://perso.ens-lyon.fr/patrick.flandrin/emd.html

I've tried the EMD method and find it to work well. The original paper on
the subject is by Huang (from NASA) and appears in Proc. of the Royal
Society, 1998.

Joe Koski

>
> 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
> -------------------------------------------------------------
>

-------------------------------------------------------------
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
-------------------------------------------------------------

```