help-octave
[Top][All Lists]

## Re: leasqr

 From: Christian T. Steigies Subject: Re: leasqr Date: Sun, 27 Jan 2002 20:27:14 -0600 User-agent: Mutt/1.2.5i

```Hi Geert, Paul,
On Thu, Jan 24, 2002 at 08:42:10AM +0100, Gert Van den Eynde wrote:

thanks for both of your hints and sorry for the late reply.

> Another possible algorithm is Prony's algorithm. It's designed to fit
> sums of exponential functions (c(i)*exp(a(i)*x)) but it also works for
> imaginary a(i), and thus for sine/cosine pairs. One drawback is the
> requirement that the data points need to be equidistant. My professor at
> university always claimed this algorithm was more stable than the least
> squares approach.... Some time ago, I implemented this for Octave but
> never got around to post it to the mailing-list. So now, here it is...
> Usual disclaimers applied. Hope it works. Comments and improvements
> welcome.

prony works fine for generated sin/cos data! Will this be added to
octave-forge? But when I use it on my data real(a(i)) > 0 which is not good
for a sine... so maybe I don't not have a clean sine wave.

I will give it another try, also fitting with better starting parameters.
Stupid question, how do I get the phase from the fft, its the angle between
the real and imaginary part? How good is this determination of the phase?
That might actually be an easier solution for what I am trying, I am looking
for the phase between two signals, where the received signal might have "no"
phase, ie the amplitude is at times very small, so I guess its hard to
speak of a phase then.

Christian

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

```