Data Analysis

The data downloaded using the download_data.py script will provide the raw EEG data that has been recorded by the IDUN Guardian. Therefore, it must be processed with common filtering techniques before it can be interpreted.

To filter and prepare the IDUN Guardian EEG data for analysis, the user is recommended to apply a notch filter (50Hz in Europe, 60Hz in North America) to remove powerline noise and a bandpass filter, between 1 - 35Hz, to remove ear-based artefacts.

Our filter recommendations require scipy.signal to be installed, and imported into the local script:

Specifically, IDUN suggests using the following code to apply basic filtering before using any other data analysis methods:

from scipy import signal

# notch filter to remove powerline noise

notch_freq = 50 # set to 50 in Europe, 60 in North America
numerator, denominator = signal.iirnotch(notch_freq, 20, 250)
filtered_notch_data = signal.filtfilt(b=numerator, a=denominator, x=dataset, padtype=None)

# bandpass filter to remove common artefacts during resting state recordings

high_pass_freq = 1
low_pass_freq = 35
denom, nom = signal.iirfilter(int(3), [1, 35], btype="bandpass", ftype="butter", fs=float(250), output="ba")
filtered_bp_data = signal.filtfilt(b=denom, a=nom, x=dataset, padtype=None)

For more further information and methods on how to analyse the data you can check out this page!

Important! Our current recording system takes 2.5 seconds to stop the recording after the user sends the STOP command (CTRL+C or the timer ends). To accommodate this limitation in our system, the analysis script is recommended to remove the last 2.5 seconds of data from the downloaded file.