This mini-project computes event-related potentials (ERPs) from ECOG data aligned to finger movement events. It extracts 1201-sample windows (200 ms pre-start, 1 ms at start, 1000 ms post-start) for each trial, averages per finger, and plots the mean ERP per finger.
fingers_erp.py: Implementscalc_mean_erpthat loads trial metadata and ECOG signal, performs QA, averages ERPs per finger, and plots the results.main.py: Script entry point that callscalc_mean_erpwith the provided data files and prints the resulting matrix shape.
Expected inputs (CSV):
events_file_ordered.csv: columnsstarting_point,peak_point,finger(all integers); each row is one trial.brain_data_channel_one.csv: one column of ECOG samples (floats), row count aligned with the indices inevents_file_ordered.csv.
Placement rules: the script will look for each CSV in this folder, its parent folder (repo root), or any subfolder whose name contains data (case-insensitive). Keep the original filenames.
Python 3.10+ with the following packages: pandas, numpy, matplotlib. Install with:
pip install -r requirements.txtOr directly:
pip install pandas numpy matplotlibFrom the repository root:
python main.pyThis will compute the per-finger mean ERPs, display the plot, and print the ERP matrix shape.