Electroencephalography signal analysis and visualization
This toolbox has been used in course "Design and Practice of Neuromarketing Experiment (腦科學行銷實驗設計與實作)" in NTUST (Taiwan Tech).
-
Input Data
- Now support regular *.edf and OpenBCI format *.txt
viewer = EEGViewer('path/to/your/data.edf');
or
viewer = EEGViewer(); viewer.Load('path/to/your/data.edf')
-
Filtering (Optional)
viewer.FIRfiltering(1, 30); % Band-pass FIR filter of 1~30 Hz
-
Re-Reference (Optional)
viewer.AverageReReference();
-
SetMinDrop / SetMaxRange (Optional)
viewer.SetMinDrop(minimum) % Default is 0 (don't drop)
viewer.SetMaxRange(maximum) % Default is the maximum of all channel's FFT data
-
SetCompressConstant (Optional)
viewer.SetCompressConstant(constant) % Default is 1 (don't compress)
Only use it when you want to compress the graph down (i.e. expand the limit of Z-axis).
-
Static Plot
viewer.PlotSingleSignal(channel) % Plot single signal spectrum viewer.PlotDoubleSignal(channel1, channel2) % Plot two signal spectrum symmetrically
-
Animated Plot Setting (Optional)
viewer.SetAnimateMaxLength(minutes) % Show only the range of the time period on screen
-
Animated Plot
viewer.AnimatedDoubleSignal(channel1, channel2, speed) % Plot animated two signal symmetrically. (default speed is 2) viewer.AnimatedMultipleSignal(channelList, speed) % Plot all animated signal in channelList (must be even number, default speed is 2)
-
Slider Double Singal Plot
viewer.SliderDoublePlot(channel1, channel2, secLength) % Show only the range of time period on screen
Ps. It share the animatemaxlength global variable and same setting of Animated Plot function in AddAuxiliaryInformation for now.
-
Slider Multiple Double Signal Plot
viewer.SliderMultiplePlot(channelList, secLength) % Show only the range of time period on screen
-
Quick view of data
viewer.ScrollView()
-
Add channel location name (for OpenBCI) (Optional)
viewer.SetChannelLocationName('ch1', 'ch2', 'ch3', 'ch4', 'ch5', 'ch6', 'ch7', 'ch8')
-
Save FFT data as CSV
This will output 1~60Hz fft data and sum of delta, theta, alpha, beta, gamma.
viewer.SaveCSV('filename') % It will auto append .csv extension after filename.
-
Statistics CSV
Output the following statistics with its value and formula (as
filename_stat.csv
)- Right frontal cortical asymmetry (alpha)
- Frontal brain asymmetry
- EEG alpha synchronization
- Posterior resting state EEG asymmetries
- Approach-Withdrawal (AW) Index
- Frontal Alpha Asymmetry
And GFP_theta table (as
filename_gfp.csv
)% [left channel nums; right channel nums] viewer.Statistics('filename', [1, 2, 3, 4; 5, 6, 7, 8]) % With only LRChannels viewer.Statistics('filename', [1, 2, 3, 4; 5, 6, 7, 8], [1, 2, 3; 5, 6, 7]) % With LRChannels and GFPLRChannels
-
Top-N Differential
Print the top-N absolute value of differential for each channel
viewer.DifferentialTopN(N)
- readOpenBCItxt.m - load *.txt output from OpenBCI's machine
- read_edf.m - *.edf data loader
- eegfilt.m - FIR Filter
- eegplot.m - Scroll view on raw data
- textsc.m - Places text in screen coordinates
- fastif.m - Fast if
Open Source Matlab Toolbox for Brain-Computer Interface research