welsh

mutis.lib.welsh(t1, d1, t2, d2, t, dt)[source]

Welsh (1999) correlation with adaptative binning.

This function implements the correlation function proposed by Welsh (1999), which allows for the computation of the correlation for -discrete- signals non-uniformly sampled in time.

Parameters
t1ndarray

Times corresponding to the first signal.

d1ndarray

Values of the first signal.

t2ndarray

Times corresponding to the second signal.

d2ndarray

Values of the second signal.

tndarray

Times on which to compute the correlation (binning).

dtndarray

Size of the bins on which to compute the correlation.

Returns
resndarray (size len(t))

Values of the correlation at the times t.

Examples

An example of raw usage would be:

>>> import numpy as np
>>> from mutis.lib.correlation import welsh_ab
>>> t1 = np.linspace(1, 10, 100); s1 = np.sin(t1)
>>> t2 = np.linspace(1, 10, 100); s2 = np.cos(t2)
>>> t = np.linspace(1, 10, 100);  dt = np.full(t.shape, 0.1)
>>> welsh(t1, d1, t2, d2, t, dt)

However, it is recommended to be used as expalined in the standard MUTIS’ workflow notebook.