NeuroAnalyzer tutorials: Analyze: Functional connectivity: PLI / PLV
Initialize NeuroAnalyzer
using NeuroAnalyzer
using Plots
eeg = load("files/eeg.hdf");
e10 = epoch(eeg, ep_len=10);Phase Locking Index
Phase Locking Index (PLI) is a measure used to quantify the consistency of phase differences between two signals across trials or time windows. It is particularly useful for studying functional connectivity and synchronization between brain regions.
PLI uses the Hilbert transform to calculate instantaneous phases, hence the signal should be narrowband. Phase values are from \(-\pi\) to \(+\pi\). We then extract the sign value of the phases to get upper and lower peaks.
\[ PLI = \frac{1}{N} \left \vert \mathrm{sgn}(\varphi_1 - \varphi_2) \right \vert \] \(\mathrm{sgn}\): sign function
PLI reflects the proportion of phase angle differences above or below the real (horizontal) axis.
PLI is not sensitive to volume conduction.
PLI is robust common noise sources.
It only measures phase synchronization, not amplitude correlation.
For multiple channels, you can compute PLI between all pairs to create a connectivity matrix.
PLI is insensitive to instantaneous (zero-lag) synchronization, which helps reduce the influence of volume conduction artifacts.
Interpretation: PLI = 0: no consistent phase locking (random phase differences), PLI = 1: perfect phase locking (constant phase difference).
High PLI: Indicates strong phase synchronization between the two signals, suggesting true interaction between sources.
Low PLI: Indicates weak or no phase synchronization.
Calculate PLI:
p, _, _, _, _ = pli(e10,
e10,
ch1="F3",
ch2="F4",
ep1=1,
ep2=1);
println("PLI: $(p[1])")PLI: 0.36484375
Weighted Phase Locking Index (wPLI) is designed to estimate the true phase synchronization between two signals, reducing the influence of spurious connections that can arise from common reference electrodes or volume conduction.
The wPLI weights each phase difference by the magnitude of the imaginary component of the cross-spectrum, which helps to downplay the contribution of phase differences around \(0\) or \(\pi\) (which are more likely to be due to volume conduction).
\[ wPLI = \frac{\left \vert \sum{\left \vert \mathfrak{I}(P_{xy}) \right \vert \times \mathrm{sgn}(\mathfrak{I}(P_{xy}))} \right \vert}{\sum{\left \vert \mathfrak{I}(P_{xy}) \right \vert}} \] \(P_{xy}\): cross spectrum density
wPLI is more robust to volume conduction and noise compared to traditional PLI (Phase Locking Index) and provides a more accurate estimate of true brain connectivity.
Calculate wPLI:
p, _, _, _, _ = wpli(e10,
e10,
ch1="F3",
ch2="F4",
ep1=1,
ep2=1);
println("wPLI: $(p[1])")wPLI: -3.578683054913585e-16
Additionally, a debiased wPLI estimator can be calculated:
p, _, _, _, _ = wpli(e10,
e10,
ch1="F3",
ch2="F4",
ep1=1,
ep2=1,
debiased=true);
println("wPLI: $(p[1])")wPLI: -0.15230134572116172
Directed Phase Lag Index (dPLI) was introduced in by Stam et al. (2012) to capture the phase and lag relationship as a measure of directed functional connectivity.
dPLI is defined as the probability that the instantaneous phase of \(x\) was smaller than the phase of \(y\) (modulo \(\pi\)).
- if \(0.5 < dPLI_{xy} \leq 1.0\), \(x\) is leading \(y\)
- if \(0.0 \leq dPLI_{xy} = 0.5\), \(y\) is leading \(x\)
- if \(dPLI_{xy} = 0.5\), neither \(x\) nor \(y\) is leading or lagging
p, _, _, _, _ = dpli(e10,
e10,
ch1="F3",
ch2="F4",
ep1=1,
ep2=1)
println("dPLI: $(p[1])")dPLI: 0.746484375
Null connectivity is 0 for PLI and wPLI, but 0.5 for dPLI.
wPLI is less sensitive to noise and is the method of choice for studying an underlying phase relationship.
To study directionality, use wPLI or dPLI.
Phase Locking Value
Phase Locking Value (PLV): reflects the proportion of phase angle differences above or below the real (horizontal) axis.
It is used for measuring synchrony (especially changes in synchrony) across brain regions/electrodes.
\[ PLV = \frac{1}{N} \left \vert \sum{e^{1i \times (\varphi_1 - \varphi_2)}} \right \vert \] \(e^{\varphi_1 - \varphi_2}\) gives the randomness of \(\Delta \varphi\)
\(N\): number of segments to average. In practice it is best if you have a large number of trials.
Interpretation: PLV \(\approx\) 0: phases are randomly distributed (no phase locking), PLV ≈ 1: phases are highly synchronized (perfect phase locking).
| Feature | PLV | PLI |
|---|---|---|
| Primary goal | Measures the stability of the phase difference between two signals | Measures the consistency of the sign of the phase difference |
| Sensitivity | All phase differences | Only non-zero phase lags |
| Volume Conduction | Affected by zero-lag artifacts | Less affected |
| Range | 0 to 1 | 0 to 1 |
| Sensitivity to noise | Less sensitive to noise | More sensitive to noise perturbations |
| Use Case | General phase synchronization | True interaction detection |
Use PLV if you want to detect any phase synchronization, regardless of lag.
Use PLI if you want to minimize the effect of volume conduction and focus on true interactions between sources.
PLV uses the Hilbert transform to calculate instantaneous phases, hence the signal should be narrowband.
Calculate PLV:
p, _, _, _, _ = plv(e10,
e10,
ch1="F3",
ch2="F4",
ep1=1,
ep2=1);
println("PLV: $(p[1])")PLV: 0.49436721273022155
Since we might be interested whether PLV changed after a stimulus, we need to normalize (using z score) using the the pre-stimulus period as a baseline (subtract z score of the baseline PLV values from PLV).
Imaginary Phase Locking Value (IPLV) was proposed to resolve PLV’s sensitivity to volume conduction and common reference effects.
\[ IPLV = \frac{1}{N} \left \vert \mathfrak{I} \left ( \sum{e^{1i \times (\varphi_1 - \varphi_2)}} \right ) \right \vert \]
p, _, _, _, _ = iplv(e10,
e10,
ch1="F3",
ch2="F4",
ep1=1,
ep2=1);
println("IPLV: $(p[1])")IPLV: 0.3635442325765876