bundles / scipy 1.17.1 / scipy / signal / _signaltools / vectorstrength
function
scipy.signal._signaltools:vectorstrength
Signature
def vectorstrength ( events , period ) Summary
Determine the vector strength of the events corresponding to the given period.
Extended Summary
The vector strength is a measure of phase synchrony, how well the timing of the events is synchronized to a single period of a periodic signal.
If multiple periods are used, calculate the vector strength of each. This is called the "resonating vector strength".
Parameters
events: 1D array_likeAn array of time points containing the timing of the events.
period: float or array_likeThe period of the signal that the events should synchronize to. The period is in the same units as
events. It can also be an array of periods, in which case the outputs are arrays of the same length.
Returns
strength: float or 1D arrayThe strength of the synchronization. 1.0 is perfect synchronization and 0.0 is no synchronization. If
periodis an array, this is also an array with each element containing the vector strength at the corresponding period.phase: float or arrayThe phase that the events are most strongly synchronized to in radians. If
periodis an array, this is also an array with each element containing the phase for the corresponding period.
Notes
Array API Standard Support
vectorstrength has experimental support for Python Array API Standard compatible backends in addition to NumPy. Please consider testing these features by setting an environment variable SCIPY_ARRAY_API=1 and providing CuPy, PyTorch, JAX, or Dask arrays as array arguments. The following combinations of backend and device (or other capability) are supported.
==================== ==================== ==================== Library CPU GPU ==================== ==================== ==================== NumPy ✅ n/a CuPy n/a ✅ PyTorch ✅ ✅ JAX ⚠️ no JIT ⛔ Dask ⚠️ computes graph n/a ==================== ==================== ====================
See
dev-arrayapifor more information.
Aliases
-
scipy.signal.vectorstrength