What I'm trying to do is recreate the techniques used in [1] for with the
purpose of
EEG classification.
More specifically I would like to compute some of the Wavelet-based
synchrony
measures shown in Appendix A.4.
There the authors do not try to extract epochs from the data but rather
extract 5 second
segments from the multichannel EEG signal, compute the phase for each
channel in every frame ,
and use that in order to compute the statistics on the differences of phase
between
channels for the same segment.
Most connectivity metrics are based on some sort of consistency of the
phase relationship between two signals across epochs/trials... In your
example, the PLV looks for how repeatable the phase difference between two
channels across epochs/trials...
Thus you may want to consider in what sense you want to compute
synchrony and what that would mean before attempting to use the
spectral_connectivity(.) capabilities of MNE.
Hi Theodore,
It looks Iike the PLV measure computed in the paper you cite is looking for the stability of the phase difference **across time samples** within 5 second epochs (and looks at how this synchrony evolves over epochs/frames) as in the reference below (noting it for the benefit of others on the list)...
I don't think this variety of PLV is implemented in mne-python... Perhaps some others on the list might be able to verify if that is indeed unfortunately the case.. It may be possible to extend cwt_morlet or similar from the time-frequency module to make a custom function to do what you are interested in.
HTH,
Hari
Ref:
Le Van Quyen, M., Foucher, J., Lachaux, J. P., Rodriguez, E., Lutz, A., Martinerie, J., & Varela, F. J. (2001). Comparison of Hilbert transform and wavelet methods for the analysis of neuronal synchrony. Journal of neuroscience methods, 111(2), 83-98.
I'm having some trouble creating the epochs object.
I can create the RawArray object and the events and info objects.
When I try to create an Epochs or EpochsArray object from these I run into
trouble.
I don't know if I can use the Epochs constructor since that requires tmin
and tmax, which I don't know how to set in this case.
I can reshape the 2d data ndarray into the (n_epochs, n_channels, n_times)
format that EpochsArray expects but I think the object created is invalid,
since I get the error
"Length of values does not match length of index" when trying to convert to
dataframe as a test of the validity of the object.
Is there a definite way to create an Epochs/EpochsArray object from a
RawArray object, and the events object?
It may be possible to extend cwt_morlet or similar from the time-frequency
module to make a custom function to do what you are interested in.
I suppose you mean using tfr_morlet <http://It may be possible to extend
cwt_morlet or similar from the time-frequency module to make a custom
function to do what you are interested in.>? I couldn't find cwt_morlet in
MNE Python.
I could then use that function in order to create the Wavelet Transform for
each sample point in each
channel for every 5s epoch, and then use those to calculate the SPLV
according to Van Quyen et al.
@Hari
I now see what you mean, I found the cwt_morlet function in the code, it
was missing from the reference docs
and that's why I couldn't find it initially, I will try using that.