I am new with EEG related terms and I am experimenting using BCI Competition IV #1 dataset. What does EEG signal epoching mean? and how can i extract epochs knowing that my eeg data is a matrix (time x channels).
EEG epoching is a procedure in which specific time-windows are extracted from the continuous EEG signal. These time windows are called “epochs”, and usually are time-locked with respect an event e.g. a visual stimulus. If your EEG data are in a matrix [channel x time] where time is the complete continuous EEG signal, after the epoching procedure you should have a matrix [channel x time x epochs] where time is the time length of each epoch, and epochs is the number of segments you extracted from continuous EEG signal. Finally, if you want to extract epochs from your signal, you should know what are the segments of interest to be analyzed, for instance, a specific stimulus.
Actually I have a file that indicates the position in time where the events occur. So I should place a time window centered around this particular position. How should be the width of this window? And by doing so, I tink some parts of the signal will be lost right? Sorry if my questions looks trivial but I am really new in this :)
The length of an actual epoch depends on the research question. It is necessary not to start the epoch with the stimulus onset, but to extract also a baseline period (e.g. 500ms) before the stimulus. This has some technical aspects, in the simplest form, you get an estimate of a "nil" signal (because before the stimulus there should be no stimulus relevant information/activity going on).
The length of the post stimulus interval heavily depends on your research question, as already mentioned above. What is the goal of your study, what do you want to analyze, event related potentials (ERP) or time-frequency decomposition or causal analyses? I think there is no way to give an answer that is always right. I would recommend to start with a good textbook on EEG analyses and to find an expert who is able to explain the necessary steps to you, because experience is quite important in this field. It is not possible to learn everythings from a textbook (even if it is a good one...).
I am start digging in this field, please can you share you experience in how did you get the knowledge you lacked on that time? I don't know how to start in learning about EEG signal processing other than reading some books i found in this question, is there a better way based on your experience?
Actually, studying EEG is quite challenging since it depends on which perspective you are considering: neuroscience, signal processing ... Mine was EEG (not only) for mobile health application where user is equipped with a user friendly device that collects EEG and other modalities (i.g. ECG) for monitoring purpose. Vital signs data are collected on mobile device, pre-processed and sent to distant server. The objective is to initially compress these data to optimize the delivery by exploiting the intra and inter correlation of multiple modalities. I strongly recommend studying such topic from deep learning perspective since it is not well investigated and it is an unusual approach compared to the classic ones.
To sum up, I recommend focusing on a particular problem (i.g. compression, classification ...) rather than studying the whole area.
It the amplitude value of the signal is calculated as minimum. what does it represents. Is it any sort of danger (means seizure indication) , normal or there indication upcoming seizure.
Same story with me. I have a 64 channel EEG with some extra channels (EMG and EOG). I have a binary table of 5 events which initially i will use only one. I created a vector called markers with the timestamps of the event in msec.I m in preprossesing stage.
If someone works similar project it would be very helpful to share with me his experience.
thank you very much for the explanation. What if the continuous EEG recording is not event related, such as recordings from epileptic rats? There will be 'baseline' phase, as well as 'seizure' phase and they are not the the same length. But there is no labeled 'onset' time points. How to segment the signal then based on, e.g., spectrogram, or amplitude?
ich have no experience with rat EEG, but there is also a whole field of "restig state EEG", which records a complete time-block, e.g. 8 minutes of EEG (in human samples). This can be decomposed in it's frequencies and compared to different recording situations (e.g. before and after anepileptic seizure). I am pretty sure there is also literature on how "normal" EEG and epileptic EEG differ, and which markers/variables are important, but I am not an expert in this field.
I have a similar problem - for my study i worked with virtual reality stimulation to investigate brain activities during different bodily states. For that reason I have different conditions over time, in which participants see an avatar in altered states (complete vs. amputated) and we synchronously stimulate either tactile or with motor stimulation.
My conditions are 150 seconds each, should i now make these into the epochs? And would the epoch start, when the condition started (or 5ms before that) and end 155 seconds after it started?
I strongly suggest to have a look at this tutorial that uses only open and free software: https://mne.tools/dev/auto_tutorials/epochs/plot_10_epochs_overview.html
It's important to clarify that an epoch, specially related to EEG signals could refer to sleep epoch, which are intervals of 30 seconds used for the classification of sleep stages, following specific guidelines.
import numpy as np from scipy.signal import butter, filtfilt import matplotlib.pyplot as plt # Load the EEG signal (assuming it is a 1-dimensional numpy array) eeg_signal = np.loadtxt('your_eeg_signal.txt') # Define the sampling frequency (adjust according to your data) fs = 250 # Sampling frequency in Hz # Plot the original EEG signal plt.figure() plt.plot(eeg_signal) plt.title('Original EEG Signal') plt.xlabel('Time') plt.ylabel('Amplitude') plt.grid(True) # Apply a bandpass filter to the signal def butter_bandpass(lowcut, highcut, fs, order=5): nyquist = 0.5 * fs low = lowcut / nyquist high = highcut / nyquist b, a = butter(order, [low, high], btype='band') return b, a def butter_bandpass_filter(data, lowcut, highcut, fs, order=5): b, a = butter_bandpass(lowcut, highcut, fs, order=order) filtered_data = filtfilt(b, a, data) return filtered_data # Define the frequency range for the bandpass filter (adjust according to your needs) lowcut = 1.0 # Lower cutoff frequency in Hz highcut = 30.0 # Upper cutoff frequency in Hz # Apply the bandpass filter to the EEG signal filtered_signal = butter_bandpass_filter(eeg_signal, lowcut, highcut, fs) # Plot the filtered EEG signal plt.figure() plt.plot(filtered_signal) plt.title('Filtered EEG Signal') plt.xlabel('Time') plt.ylabel('Amplitude') plt.grid(True) # Perform additional signal processing as needed (e.g., feature extraction, artifact removal, etc.) # Show the plots plt.show()