mpylab.tools.sin_fit module

This is mpylab.tools.sin_fit.

Provides a sinus fit function

author:

Hans Georg Krauthäuser (main author)

license:

GPL-3 or higher

mpylab.tools.sin_fit.fit_sin(tt, yy)

Fit a sinusoid to uniformly sampled values.

Parameters:
  • tt (array-like) – Sample times with uniform spacing.

  • yy (array-like) – Values corresponding to tt.

Returns:

Fitted amp, angular frequency omega, phase, offset, ordinary freq, period, callable fitfunc, maximum covariance maxcov, and the raw optimization data rawres.

Return type:

dict