||EEG - Alpha Band Extraction|
|Tags||extract☁eeg☁alpha frequency band|
Electroencephalogram (EEG) acquired signals reflect the neuronal activity of specific brain areas. For each signal the magnitude of different frequency bands can be extracted, which vary when performing specific tasks.
This Jupyter Notebook provides a simple example on how to extract the alpha frequency band as well as the alpha band power from an EEG acquisition. For further information on EEG frequency bands please refer to Electroencephalography Freq. Bands . The absolute value of alpha band power can be used inter alia to evaluate the state of eyes open or closed. It is measured by integrating the area of the power spectrum in the range of the alpha frequencies. The band power represents the magnitude of a specific frequency band.
Alpha-band oscillations range in frequencies of 8-12 Hz and originate in the occipital lobe. Alpha waves are associated to a specific process and are mainly present when the eyes are closed and mainly blocked when the eyes are open.
Read more detailed information on Alpha Waves .
1 - Importation of the needed packages
# Biosignalsnotebooks python package import biosignalsnotebooks as bsnb # Scientific packages from numpy import loadtxt, array, mean, logical_and, trapz from scipy.signal import spectrogram, welch
# Load Data from file path data, header = bsnb.load_signal("eeg_sample_closed_open_eyes", get_header=True) # [The acquired EEG data is at channel 1 ("CH1")] eeg_data = data["CH1"]
2.1 - Store some acquisition constants inside variables
Two extremely relevant parameters defined before data acquisition are the sampling rate and ADC resolution
sr = header["sampling rate"] # Sampling Rate resolution = header["resolution"]
2.2 - Conversion of ADC sample values to physical units (uV) and generation of a time-axis
The device used to acquire EEG data belongs to the "biosignalsplux" model, information that should be passed as an input of raw_to_phy function.
#Unit Conversion signal_uv = bsnb.raw_to_phy("EEG", "biosignalsplux", eeg_data, resolution, "uV") time_uv = bsnb.generate_time(signal_uv, sr)
2.3 - Plotting the Raw Data
The following plot illustrates the raw eeg data for open and closed eyes:
bsnb.plot_eeg_signal_wind(time_uv, signal_uv, time_range=[58, 200], time_windows_evt_1=[(58, 89), (119, 149)], time_windows_evt_2=[(89, 119), (149, 179)], y_axis_label="Electric Voltage (uV)")