lmlib.utils.beta.diff0#
- lmlib.utils.beta.diff0(y)#
Gets difference of consecutive elements in vector, starting with the first element
This is the same as
numpy.diff(y)
, but starting with the first elementy[0]
as the first difference (leading to a vector of the same length as the input signal vector y.Implementation:
return np.append(np.array(y[0]), np.diff(y))
- Parameters
y (array_like of shape(K,) of floats) – input signal vector
- Returns
out – element-wise differences
- Return type
ndarray of shape(K,) of floats