How to get the phase of alpha over time?


I hope everyone is well!
I am looking for some pointers on how to start phase analysis.
My goal is to get the phase of alpha at each time point of a trial.
Is there a way to extract this using mne?

Many thanks!

Ana P

@anapesq - For phase connnectivity analysis look into PLI and wPLI. If you are just looking for the phase, you can do the following inspired by the scipy page:

#raw.resample(50) - uncomment to make it faster
raw.filter(8,12)  #Extract the alpha

epochs = mne.Epochs(raw, events)
phase_mat = np.array([np.angle( for epoch in epochs])
#Have to remake the epochs because the numbers are no longer complex
phase_epochs = mne.EpochsArray(phase_mat,  


This is channel level, but you can do similar for the source level activity.



@jstout211 Thank you so much for your answer!