pyeeg.connectivity.wPLI

pyeeg.connectivity.wPLI(x, fs=1, nfft=None, fbands=None)

Weighted Phase Lag Index (wPLI).

wPLI is an extension of the phase lag index that weights the phase differences by the magnitude of the imaginary part of the cross-spectrum, making it more robust to noise. Values lie between 0 and 1, where higher values indicate stronger phase coupling between two signals that cannot be attributed to volume conduction.

If the input is a single trial (2d), it is first jackknife resampled along the trial axis (see jackknife_resample()) to obtain a distribution of wPLI estimates; the returned value is the sum across the resulting trials.

Parameters:
  • x (ndarray (nsamples, nchannels) or (ntrials, nsamples, nchannels)) – Input data. If 2d, jackknife resampling is applied first.

  • fs (float) – Sampling frequency of the signal (in Hz). Default is 1.

  • nfft (int, optional) – Length of the FFT. If None, nfft = nsamples (passed to csd_ndarray()).

  • fbands (tuple of float, optional) – Frequency band (fmin, fmax) over which to average the wPLI. If None, the full wPLI spectrum is returned.

Returns:

C – wPLI connectivity matrix. If fbands is given, the spectrum is averaged over the band and a single value per channel pair is returned; otherwise the full spectrum (nfreqs = nfft // 2 + 1) is returned.

Return type:

ndarray (nchannels, nchannels) or (nchannels, nchannels, nfreqs)

References

Vinck, M., Oostenveld, R., van Wingerden, M., Battaglia, F., & Pennartz, C. M. (2011). An improved index of phase-synchronization for electrophysiological data in the presence of volume-conduction, noise and sample-size bias. NeuroImage, 55(4), 1548–1565. https://doi.org/10.1016/j.neuroimage.2011.01.055

FieldTrip reference implementation for variance estimation of the jackknife: https://github.com/fieldtrip/fieldtrip/blob/master/connectivity/ft_connectivity_wpli.m