BCI Projects
From ESE497 Wiki
Jump to navigationJump to search- Project3: BCI Offline Analysis - Signal Detection
- Plot R^2 for all Channels/Frequency Pairs
- Start with OfflineAnalysisSpectral.m. This is the file you will modify for this project.
- Open in Matlab. Click on File-Set Path and "Add with subfolders" the Tools folder from the BCI2000 folder
- Click the Run arrow. Select eeg1_1.dat, eeg1_2.dat and eeg1_3.dat. Click Open
- Remove the DC (average) for all 64 channels
for ch=1:size(signal, 2) signal(:, ch)=signal(:, ch)-mean(signal(:, ch)); end
- Implement CAR Spatial Filtering using the BCI2000 funtion carFile
signal = carFilt(signal,2) ;
- For every channel compute the power spectrum for every segment of 80 samples every 40 samples for both condition==0 and condition==2 and average them. Create two 3D array of PowerSpectra of size(NumFrequencies,NumChannels,NumTrials) for both conditions.
- Compute the R^2 function for all Channel/Frequency pairs the BCI2000 function calc_rsqu. Type "which calc_rsqu" at the matlab command prompt to locate calc_rsqu.m.
- Plot the R^2 values for all Channel/Frequency pairs using the Matlab function surf. It should look similar but not identical to the graph on the tutorial.
- Useful Matlab Functions:
- find
- spectrogram
- surf
- After calling surf, you should execute the following line to eliminate those pesky yellow lines
set(gcf,'Renderer','Zbuffer')
- Project4: BCI Offline Analysis - Signal Classification
- Combine best Channel/Frequency pairs using eeg1_(1,2,3).dat (use lda.m)
- Plot the power in the 4 best Channel/Frequency pairs for the action and the rest conditions using the eeg1 data vs. trial
- Plot the action and rest results of the LDA vs. trial
- Plot the ROC for the 4 best Channel/Frequency pairs and the LDA
- Results
- Collect your own data using the Emotiv Headset
- Combine best Channel/Frequency pairs using your own data
- states.StimulusCode values for stimulus presentation
- 0: Gray Screen - Relax, blink, move around, etc.
- 1: Left - Clench left hand
- 2: Pause - Unclench
- 3: Right - Clench right hand
- states.StimulusCode values for stimulus presentation
- Combine best Channel/Frequency pairs using your own data
- Useful Matlab Functions:
- subplot
- save, load
- squeeze
- Combine best Channel/Frequency pairs using eeg1_(1,2,3).dat (use lda.m)
- Project 5: Move sbRIO robots based on BCI algorithm using EEG1 data
- Re-Package your Matlab code into 2 scripts that
- 1) Acquire the trials: Read the trials from the .dat files and return 1 trial every time it is called.
- 2) Process the trials: Compute the LDA measure from the current trial.
- The reason why you want to separate the processing of the trials from the acquisition of the trials is because in project 6, the trials will be acquired from the Emotiv headset.
- Test these new functions in a for loop in Matlab and make sure you LDA results match the results from before
- Call your matlab functions from inside BCI.vi and move the robots every time the action is detected. Verify that you get the number of errors you expected and that the LDA calculation matches from before.
- Re-Package your Matlab code into 2 scripts that
- Project 6: Implement in real-time with Emotive headset
- Emotiv LabVIEW code
- Emotiv.vi returns up to 128 samples (@ 128 Samples/sec) per channel. If your trials need to be longer than 1 second then you will need to buffer up the Emotiv.vi output.
- If you call Emotiv.vi once per second as in EmoTop.vi, it returns a 128x22 matrix. Look at the column headings in Emotiv.vi to see which columns correspond to your data.