Analyze Electrooculography (EOG)#

This example can be referenced by citing the package.

This example shows how to use NeuroKit to analyze EOG data.

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import neurokit2 as nk
# This "decorative" cell should be hidden from the docs once this is implemented:
plt.rcParams['figure.figsize'] = [15, 5]  # Bigger images
plt.rcParams['font.size']= 14

Explore the EOG signal#

Let’s load the example dataset corresponding to a vertical EOG signal.

eog_signal ='eog_100hz.csv')


Let’s zoom in to some areas where clear blinks are present.


Clean the signal#

We can now filter the signal to remove some noise and trends.

eog_cleaned = nk.eog_clean(eog_signal, sampling_rate=100, method='neurokit')

Let’s visualize the same chunk and compare the clean version with the original signal.

nk.signal_plot([eog_signal[100:1700], eog_cleaned[100:1700]], 
               labels=["Raw Signal", "Cleaned Signal"])