How to calculate phase synchrony?

Hello @jamshark70,

many thanks for the update!

Tested:

Seems to work with the brainwaves - I will investigate further.

May I ask where you got the formula from? This video seems to use a more complicated one.

Btw, earlier I was suggested to learn from Thatcher’s paper ‘Hand Calculator Calculations of EEG Coherence, Phase Delays and Brain Connectivity’ - I didn’t manage to spend quality time with the formulas in this paper yet. Perhaps useful to have the link here.

On my phone, no access to YouTube. So I can’t see the other formula (and I tend to avoid video tutorials of subjects that I could read about more quickly).

This site – How to Calculate Pearson Correlation Coefficient: 9 Steps – says it’s sum((x - x_mean) * (y - y_mean)) / ((n - 1) * x_stddev * y_stddev). That’s what my code is doing. I only folded the terms of the numerator sum, x standard deviation sum and y standard deviation sum into one loop (iterate once instead of three times).

hjh

1 Like

great, thanks @jamshark70. Your help is greatly appreciated!

I study and experiment a bit more, then update the topic here.

cheers, k