Skip to content

Phase lock

phDiff(a, b)

Cosine of phase difference.

This function estimates the phase difference of the two entries and its cosine.

\[PL = \cos{(a - b)}\]

Parameters:

Name Type Description Default
a double

Phase 1 in \(\pi\) rad.

required
b double

Phase 2 in \(\pi\) rad.

required

Returns:

Name Type Description
double

Cosine of phase difference.

Example

import numpy as np a = np.pi b = - np.pi print(phDiff(a,b)) 1.0

References

.. [1] Lord et al,. (2019). Dynamical exploration of the repertoire of brain networks at rest is modulated by psilocybin. NeuroImage, 199(April), 127–142. https://doi.org/10.1016/j.neuroimage.2019.05.060

Source code in dynfc/phDiff.py
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
def phDiff(a, b):
    """Cosine of phase difference.

    This function estimates the phase difference of the two entries and its cosine.

    $$PL = \cos{(a - b)}$$

    Args:
        a (double): Phase 1 in $\pi$ rad.
        b (double): Phase 2 in $\pi$ rad.

    Returns:
        double: Cosine of phase difference.

    Example:
            >>> import numpy as np
            >>> a = np.pi
            >>> b = - np.pi
            >>> print(phDiff(a,b))
            1.0

    References
    ----------

    .. [1] 
    Lord et al,. (2019). Dynamical exploration of the 
    repertoire of brain networks at rest is 
    modulated by psilocybin. NeuroImage, 199(April), 127–142. 
    https://doi.org/10.1016/j.neuroimage.2019.05.060

    """

    c = cos(a - b)
    return c