This repository contains MATLAB code for analyzing EEG entrainment for the following paper: Exploring neural entrainment and synchrony in response to repeated 60 Hz flickering white light in healthy volunteers.
The analyses focus on phase-locking value (PLV) between channels, frequency-domain measures (FFT/STFT), and regional network metrics across multiple days and groups (control vs active).
- Computes time-resolved PLV and aggregates by condition, day, and subject
- Produces group comparisons with non-parametric statistics and multiple-figure exports
- Summarizes regional effects (within- and between-region pairs) including effect sizes and p-values
main.m
: high-level entry point for batch analysesPLV_plots.m
: end-to-end PLV computation, statistics, and figure/CSV exportcalculate_timeresolved_plv.m
,visualize_plv_data.m
,compare_plv_groups.m
,compare_network_metrics.m
: core PLV utilitiesFFT_plots.m
,STFT_plots.m
,plotFFT.m
,plot_topography.m
: spectral and visualization utilitiesswtest.m
,fdr_correction.m
: statistics helperssample_locs/
: electrode location templates for topography plotting
- MATLAB R2020a or newer
- Toolboxes: Statistics and Machine Learning Toolbox, Signal Processing Toolbox
Analyses expect preprocessed EEG arranged by subject, day, and stimulation type. Internally, scripts access data as:
data_struct.(subject).(day).(stim).data_clean
- Figures: PLV matrices, group comparisons, regional time courses, effect-size heatmaps (PDF/PNG)
- Tables: descriptive statistics and inferential results (e.g.,
descriptive_analysis.csv
,statistical_analysis_results.csv
,plv_regional_effect_sizes.csv
)
If you use this code, please cite the accompanying paper and dataset:
- Paper: Exploring neural entrainment and synchrony in response to repeated 60 Hz flickering white light in healthy volunteers PLOS ONE, 2025, https://doi.org/10.1371/journal.pone.0332310
- Dataset: Zenodo, https://doi.org/10.5281/zenodo.17019688