exp_decay

exp_decay(x, y)[source]

Get exponential decay parameter from monotonically increasing (decreasing) curve.

This assumes following function form.

\[y(x) = e^{\alpha x}\]

We can calculate \(\alpha\) as

\[\alpha = \log(y(x)) / x\]

To find this number, the numpy polynomial fit with deg=1 is used.

Parameters:
  • x (ndarray) – Array of x values.

  • y (ndarray) – Array of y values.

Returns:

Decay rate of signal.

Return type:

float