exa.core.util.model_functions.get_decaying_oscillation_fitter

exa.core.util.model_functions.get_decaying_oscillation_fitter#

get_decaying_oscillation_fitter(amp_guess=None, t2_guess=None, freq_guess=None, phase_guess=None, offset_guess=None)#

Generates a fitter function for exponentially decaying sinusoidal oscillation.

The fitter will do a least-squares fit to the model \(y(x) = A \exp(-x / T) \cos(2\pi f x + \phi) + B\), where \(A>0\) is amplitude, \(f>0\) is frequency, \(T>0\) is exponential decay constant, and \(B\) si offset. The ESPRIT method will be used to get initial guesses for the least-squares fit, see esprit(). The arguments can be used to override the guesses from ESPRIT method.

Parameters:
  • amp_guess (float | None) – Initial guess for \(A\).

  • t2_guess (float | None) – Initial guess for \(T\). Typical use case is the T2 Ramsey time.

  • freq_guess (float | None) – Initial guess for \(f\).

  • phase_guess (float | None) – Initial guess for \(phi\).

  • offset_guess (float | None) – Initial guess for \(B\), defaults to mean of the data.

Returns:

The fitting function.

Return type:

Callable