This study centers on creating a real-time algorithm to estimate brain-to-brain synchronization during social interactions, specifically in collaborative and competitive scenarios. This type of algorithm can provide useful information in the educational context, for instance, during teacher-student or student-student interactions. Positioned within the context of neuroeducation and hyperscanning, this research addresses the need for biomarkers as metrics for feedback, a missing element in current teaching methods. Implementing the bispectrum technique with multiprocessing functions in Python, the algorithm effectively processes electroencephalography signals and estimates brain-to-brain synchronization between pairs of subjects during (competitive and collaborative) activities that imply specific cognitive processes. Noteworthy differences, such as higher bispectrum values in collaborative tasks compared to competitive ones, emerge with reliability, showing a total of 33.75% of significant results validated through a statistical test. While acknowledging progress, this study identifies areas of opportunity, including embedded operations, wider testing, and improved result visualization. Beyond academia, the algorithm's utility extends to classrooms, industries, and any setting involving human interactions. Moreover, the presented algorithm is shared openly, to facilitate implementations by other researchers, and is easily adjustable to other electroencephalography devices. This research not only bridges a technological gap but also contributes insights into the importance of interactions in educational contexts.
Keywords: EEG; Python; bispectrum; brain-to-brain synchronization; physiological signals; real-time algorithm.