# Compute phase coherence between two eeg signals

I have two EEG signals/channels and I would like to compute phase coherence in MATLAB. I have this paper: https://www.nature.com/npp/journal/v39/n5/full/npp2013330a.html but it does not say what Sij is so I don't know the formula.

Can anyone advise me on how to do this or does anyone have MATLAB code?

Many thanks.

• Wouldn't the cross correlation function give you this (xcorr is Matlab)? It will give you relative coherence versus time delay between the two signals. – Dan Boschen Jun 24 '17 at 17:18
• @DanBoschen Phase coherence outputs a value between 0 and 1. I don't think xcorr does that. – Ali Gul Jun 24 '17 at 17:28
• Sure it does, you just need to normalize it by dividing by the total number of samples and the standard deviations of both signals. – Dan Boschen Jun 24 '17 at 17:30
• He is asking for phase coherence – user28715 Jun 24 '17 at 17:34
• @StanleyPawlukiewicz Correlation implies phase coherence; the only way you can get a normalized correlation magnitude of 1 between two signals is if they are coherent in phase. The complex result will indicate the phase shift between the signals and by using the cross correlation function you can detect if there is a gross time delay between the signals (yet they are still phase coherent once aligned in time by the static offset) – Dan Boschen Jun 25 '17 at 11:01

[Cxy,f] = mscohere(sig1,sig2,[],[],[],Fs);