Does anyone have a snippet for determining the spectral coherence of EEG data from two channels? I’m not really sure where to begin and a starting point would be really helpful. Thanks.
@HindBrain What are you using for analysis? Python? Matlab? I’m assuming you’re referring to post-processing, not doing it in realtime?
Also, the Wikipedia article on the topic — Coherence (signal processing) — could help.
A crude measure of the synchrony (but not coherence) of a particular frequency could be had by running two signals through a bandpass filter and then summing them (this could be done sans scripting in Brainbay or Openvibe, for example)
Good luck, and let us know how you make out.
There is also a coherence function in scipy.signal. See the docs page.
Thanks for the links.
A note for anyone else who tries using the scipy.signal coherence function @AdamM mentioned: it’s is in the development version of Scipy, which you have to build from source. After I figured out why the coherence stuff wasn’t working using a stable versions of Scipi installed with
pip install, I built it from source and it wasn’t hard.
@HindBrain I have added a basic coherence function to EEGrunt, using pyplot’s cohere function to plot coherence at different frequencies. It’s quite basic. As soon as I get a chance, I’ll looking into writing something to get coherence over time for a specific frequency band (which could be turned into a spectrogram like Chip’s).