CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/main/seminar1/seminar1-working-with-eeg.ipynb
Views: 63
mne.io includes the funtions for different EEG-record formats
Optional To Do File formats (EDF, FIFF)
Get some info about a record
Channel selection and adding a montage
Explore the signals
Band-pass filtering
It's better to remove low-freq components < 1 Hz and high-freq > 50Hz (non-informative for EEG)
Let's use 4-th order Butterworth filter (default IIR filter)
Plot EEG signals
Extracting events
Mne has several functions for event selection.
mne.find_events
is used when events are stored in trigger channels (e.g. FIFF format)mne.events_from_annotations
is used for when events are stored in annotations (EDF+ format)
Look for documentation for your EEG-record format
Here we have EDF+ format
Check that length is right
PSD on epochs differs from the raw. More averaging is used
Independent Component Analysis for Artifact Removal
Inspect ICA components more deeply. Check out spectrogram. Segments info is not very relevant here since we build ICA on the raw data
We expect to see alpha and beta rythms picks on the spectrogram for good components (7-13 Hz and 13-30Hz respectively). And also slight decrease as frequency goes higher