Sine Wave Curve Fit Question

marek.rocki at wp.pl marek.rocki at wp.pl
Wed Jan 30 13:05:34 EST 2008


Iain Mackay napisal(a):
> Python Folks
>
> I'm a newbie to Python and am looking for a library / function that can help
> me fit a 1D data vector to a sine  wave. I know the frequency of the wave,
> so its really only phase and amplitude information  I need.
>
>  I can't find anything in the most widely known libraries (they seem to be
> strong on polynomial fitting, but not, apparently, on trig functions) and I
> wondered if any one here had recommendations?
>
>  Something that implemented IEEE 1057 , or similar, would be perfect.
>
>
> TIA
> Iain

I'm not aware of any specialized library, but how about using numpy
and running FFT on your data? If you already know the frequency, you
can easily extract phase and scaled amplitude from the result.

Regards,
Marek



More information about the Python-list mailing list