Video Navigator
-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
Goals of Pre-processing Data
Get the raw data into a format that we can look at
Below is the goal of each step, and the corresponding data processing step that helps to achieve the goal.
- Reduce noise in the data
- Filtering
- Artifact Rejection
- Bad Channels
- Transform the data so it can be compared across trials, conditions, etc.
- Baseline correction
- Re-referencing
- Extract segments of data from the EEG that are time locked to events in the experiment
- Epoching
- Create and ERP waveform that can be used to compare participants
- Averaging
Pre-processing Data Steps
The order of these steps depends on if you have DC or AC data
- Filter the data
- Look for and deal with any bad channels
- Re-reference the data
- Epoch the data
- Baseline Correct the data
- Note steps 4&5 are the same in ERPlab
- Artifact Rejection
- Average the Data
DC Offset
Before you start filtering...DC Offset
- What is the DC offset?
- Takes the average of the entire recording and shifts the recording so it averages to 0
- Depending on where we are recording, we may start at a different voltage level
- Averaging them to 0 brings them to alignment with each other
- Without DC offset it will be much more difficult to visually compare the electrode recordings to each other
- Takes the average of the entire recording and shifts the recording so it averages to 0
- When do you do a DC Offset
- When collecting DC data rather than AC
- During the first stage of processing when you filter the data
Why Filter
- Improve visual inspection and interpretation
- Reduce noise that is not brain activity
- Reduce noise from the environment
- Reduce 60 Hz equipment noise
- Reduce noise from the participant
- Reduce EMG frequencies over 100 Hz
- Reduce skin potentials and drift
- Reduce noise from the environment
- Brain activity is only ~.1 to 30 Hz
Frequency Filters
- Frequency filters are like coffee filters
- Coffee filters allow coffee to pass through the filter, and block the unwanted grounds
- Frequency filters set a threshold that allows certain frequencies to pass (retain), and block the unwanted frequencies (attenuate)
- 4 primary filters which we will talk about today
- Low pass
- High pass
- Band pass
- Notch
- Note: Most filters are a linear operation, so order of operations does not matter
- In our process, we do the DC offset within the filtering process, making filtering at the beginning a good option
Low Pass Filters
- Only frequencies below the threshold (i.e. they are low enough) can pass through to stay in the data.
- Example: If you put up a gate, only something things can get under the gate. A tall giraffe could not get under the gate, but a small mouse could
- Low pass filters mostly reduce electrical noise and EMG (muscle) noise
- Example of a low pass filter
- Example graph (right side of the screen)
- Original data (black line) starts with jagged, high-frequency noise
- Using the filter smooths out those edges, making the data look more like the red line
- Allows us to view the more general peaks, rather than all the noise peaks
- Deciding the threshold of the filter (left side of the screen)
- Think about how much we are letting pass through (letting different amounts of different frequencies through)
- It is not an on or off switch
- Below 30 Hz, the amount of the frequencies getting through the filter is more
- Above 30 Hz, the amount of frequencies getting through the filter is less
- Half amplitude cut off is where about 50% of that frequency is getting through
- Think about how much we are letting pass through (letting different amounts of different frequencies through)
- Example graph (right side of the screen)
High Pass Filters
- Only let frequencies higher than the threshold frequency can pass through
- Limitation: high pass filters can create artificial peaks and reduce parts of the wave
- ALWAYS good to look at what your filter is doing to the data!
- High pass filters mostly used to reduce slow changes in voltage (e.g. skin potentials which are much lower in frequency)
- Example of high pass filter
- What happens to the data (right side of the screen)
- The higher the high pass filter, the more squat the waveforms get
- High pass filters reduce the amplitude of your waveform, which may not be desirable depending on what component you are interested in
- Visualization of the filter (left side of the screen)
- Upper example
- Similar to low pass filter example
- Lower example
- More similar to what you may see in a program
- Such small numbers means the program will often show you a straight line, but in actuality it is not an off vs. on, rather it is more of a curved effect like the other filter
- Upper example
- What happens to the data (right side of the screen)
Bandpass Filters
- If you put together a low and a high pass filter, you get a bandpass filter
- The range of frequencies in-between your thresholds can pass through
Notch Filters
- Cuts out a small notch of frequencies -- very narrow band of frequencies removed; most frequencies untouched
- Often used for 60 Hz electrical noise from lights
Filter Types: Summary
- Low Pass Filters allow the lower frequency data through, attenuating the higher frequency data
- High Pass Filters allow the higher frequency data through, attenuating the lower frequencies
- Band Pass filter allows only a band of data through
- Notch Filters allow all data through, except for data at a specific frequency, which it removes.
Process in Matlab
- Open Matlab and set a path
- Set Path
- Add with subfolders (to ensure your grab all folders within the selected folder)
- Navigate to wherever your plugins are
- Save the path if you can, and close
- Set Path
- Type "eeglab" in the command window to pull up the EEGlab and ERPlab GUI
- Import raw data file
- File > Import data > Using eeglab function and plugins > From Brain Vis. Rec. .vhdr or .ahdr file
- Navigate to data file and select the applicable .vhdr file
- Click ok on the question pop up
- Name it the subject number
- We can confirm the data is loaded by
- Datasets tab - whatever dataset has a checkmark next to it is your active dataset
- Checking the info in the GUI - there is info in the right column for each of the descriptors of the data
- EEGlab > Plot > Channel Data (scroll) - if there is data in the plot, we know the data is loaded
- Filter the data
- ERPLAB > Filter and frequency tools > Filters for EEG data
- In the Basic Filter GUI for continuous data that pops up we can see:
- Image of what it thinks the filter will do to the data
- Filter type (we use IIR Butterworth filter)
- Under Cutoff frequencies, check the Remove mean value (DC bias) before filtering
- Thresholds for High-Pass and Low-Pass filters (grey when inactive, yellow when active)
- High-Pass at .1
- Low-Pass at 30
- Play around with these values to see what they do to your data
- Click Apply to filter the data with those values
- Name it: _filt tag tells you what just happened to the data
- Save it as file: Can save the data elsewhere on your computer to save this step
- Depending on your version you may be asked to save your old dataset, which is necessary if you want the old dataset in your Datasets tab list
- Plot > Channel Data (scroll) to see the filtered data
- Can scroll through the entire data time length, as well as change the scale
- In comparing different datasets, make sure they are on the same scale, otherwise it is more difficult to
- If you want to refilter the data, go back to the raw dataset in the datasets tab
- If it asked to save the dataset you are navigating away from, make sure you do so
- After re-filtering, make sure to name it something different from your first filtered data to differentiate
- You can then plot each filtered dataset to compare the data between filters
Additional Information
PURSUE teaching modules provide instructors with everything they need to add EEG/ERP content in existing courses, teach a full semester course, or train research assistants in the lab. Follow this link to Lab Training Modules that can be used with tutorial videos.
Associated Teaching Modules: Lab Training Modules, Filtering EEG/ERP Data