Adapted from https://github.com/iqgnat/SSVEP_phase_latency from MATLAB to python
[1] Jie P , Gao X , Fang D , et al. Enhancing the classification accuracy of steady-state visual evoked potential-based brain-computer interfaces using phase constrained canonical correlation analysis[J].Journal of Neural Engineering, 2011, 8(3):036027.
Benchmark dataset [2]_ from Tsinghua university.
[2] Wang Y , Chen X , Gao X , et al. A Benchmark Dataset for SSVEP-Based Brain-Computer Interfaces[J].IEEE Transactions on Neural Systems and Rehabilitation Engineering, 2017, 25(10):1746-1752.
if everything is ok, you will get the mean_latency ≈ 136ms
the result is same as the source code from https://github.com/iqgnat/SSVEP_phase_latency
***2022.6.23 we delete -180 when solving for the phase, which is different from the source code.
Thanks to [TangQi](iqgnat (Tang Qi) (github.com)), the author of the source code, for his patience in responding to my questions.