Mu Rhythm Off-line Analysis Tutorial: Difference between revisions
m MuTutorial moved to Mu Rhythm Off-line Analysis Tutorial: more descriptive title |
Roostenveld (talk | contribs) added matlab category |
||
| (6 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
== Starting an | == Starting an Analysis Session == | ||
Every recording session has its own history. It is very difficult to say in advance what might happen during the recording. So we will assume that everything was perfect (the subject collaborated, no channel went lost, etc); later on we will consider the main causes of contamination, how to recognize it and what to do. | Every recording session has its own history. It is very difficult to say in advance what might happen during the recording. So we will assume that everything was perfect (the subject collaborated, no channel went lost, etc); later on we will consider the main causes of contamination, how to recognize it and what to do. | ||
If the recording session | If the recording session runs smoothly, you should now have in the folder ''\TestData\Data\Mu'', two files named ''ALFAS006R01.dat'' and ''ALFAS006R02.dat'', corresponding to two of the eight runs usually recorded, respectively. | ||
Before you start the analysis you should locate on your hard disk | Before you start the analysis you should locate the correct montage file on your hard disk. This is a file that describes the list of channels that were acquired. In this tutorial we will use ''Complete_Montage(suggested choice).mmf'', which is located in the folder ''\TestData\Montage''. If you need to edit the *.mmf file, check its data format. | ||
== Opening | == Opening Files with Mario == | ||
After having run mario.exe, press "Select Data Files". | After having run mario.exe, press "Select Data Files". | ||
| Line 18: | Line 17: | ||
A green box will surround the Raw Data box in the main window. | A green box will surround the Raw Data box in the main window. | ||
As an optional (but recommended) operation, | As an optional (but recommended) operation, click on the LOAD MONTAGE button and choose the mmf file. This will allow you to see the labels of each channel and allow you to apply spatial filters that depend on the electrode position. | ||
You can load an additional parameters file with choices different from those used during the experiment. | |||
At this point, you can check that Mu is selected in the Analysis menu (indicating that a Mu dataset has been recognized) and | At this point, you can check that Mu is selected in the Analysis menu (indicating that a Mu dataset has been recognized) and click on the LOAD DATA button to confirm your choices. This will enable the EDIT CHANNEL LIST button that you can use to select the channels you want to include in your analysis. | ||
== Selecting Channels == | == Selecting Channels == | ||
When you select the EDIT CHANNEL LIST button, two forms will show you the channel list (valid ones and not-valid ones) and an image showing valid channels and their location. | |||
Clicking on Add and Remove buttons you | Clicking on Add and Remove buttons allows you to move a channel from one list to the other, enabling or disabling it. | ||
== Selecting the Spatial Filter == | == Selecting the Spatial Filter == | ||
Return to the main window, and you can choose which filter to apply for your analysis, selecting from the following filter choices: | |||
:*RAW | |||
:*CAR | |||
:*Large Laplacian | |||
:*Small Laplacian | |||
Common Average Reference (CAR) will be fine for most of the situations. | |||
We hope, soon, to release a user defined solution for any custom analysis. | |||
We hope to release | |||
== Feature Extraction Analysis == | == Feature Extraction Analysis == | ||
The Analysis field in the Feature Extraction panel will appear automatically according to loaded | The Analysis field in the Feature Extraction panel will appear automatically according to the files loaded, while the Feature Extractor field shows the only currently possible choice. | ||
You can view/edit analysis details by | You can view/edit analysis details by clicking on "Set Analysis Details" and "Set F.E. parameters" | ||
This second form reports all the settings for the parametric (autoregressive) spectral estimation stage. Most of the values are set after the corresponding values used on-line (see BCI2000 setup for Mu). | This second form reports all the settings for the parametric (autoregressive) spectral estimation stage. Most of the values are set after the corresponding values used on-line (see BCI2000 setup for Mu). Using the settings in the figure, the analysis software will: | ||
:*data recorded at 200 Hz sampling rate | :* analyze data recorded at 200 Hz sampling rate | ||
:* remove the mean value | :* remove the mean value | ||
:* sample the spectrum at points starting from 0 Hz to 60 Hz, every 0.2 Hz. | :* sample the spectrum at points starting from 0 Hz to 60 Hz, every 0.2 Hz. | ||
:* Identify an auroregressive model of order 16 | :* Identify an auroregressive model of order 16 | ||
:* average these values into 2 Hz wide bins | :* average these values into 2 Hz wide bins | ||
:* take a 1 s long epoch of data | :* take a 1 s long epoch of data | ||
You can modify these settings according to your aims. Changing the model order, for instance, brings sometimes to interesting results. Remember though that in the online version, spectral estimation is performed in epochs as short as 200 ms (i.e. 40 samples, at 200 Hz sampling rate), so you should avoid using model order higher than half the samples available in the epoch. | You can modify these settings according to your aims. Changing the model order, for instance, brings sometimes to interesting results. Remember though that in the online version, spectral estimation is performed in epochs as short as 200 ms (i.e. 40 samples, at 200 Hz sampling rate), so you should avoid using a model order higher than half the samples available in the epoch. | ||
When you are | When you are finished, remember to confirm your choices by slecting DONE. | ||
In addition, a button in the Spectral Extimation frame allows you to revert to the original values. | |||
Altogether you have to specify: | Altogether you have to specify: | ||
:* which data (in each trial) you want to take into account. Mu will only use the part of the trial when the cursor is visible, while MuExtended will take into account all the period when the target is visible. To learn more, see section D2Box Application States | :* which data (in each trial) you want to take into account. Mu will only use the part of the trial when the cursor is visible, while MuExtended will take into account all the period when the target is visible. To learn more, see section D2Box Application States | ||
:* If you have made an artifact rejection (or noted on the run sheet during the acquisition which trials contain artifacts), you can instruct the software not to use them | :* If you have made an artifact rejection (or noted on the run sheet during the acquisition which trials contain artifacts), you can instruct the software not to use them | ||
:* Finally, you must decide how the software must extract EEG epochs from the continuous data | :* Finally, you must decide how the software must extract EEG epochs from the continuous data | ||
The epochs can be partially overlapped. This attenuates the data loss in case the length of a trial is not a multiple of the length of an epoch. | The epochs can be partially overlapped. This attenuates the data loss in case the length of a trial is not a multiple of the length of an epoch. | ||
The percentage of overlap can be set both in Mario GUI and in any batch script. It | The percentage of overlap can be set both in Mario GUI and in any batch script. It is equal to the value of the ''MU_params.overlapping'' variable and the corresponding GUI field can be found by clickiing on ''Set Analysis Details'' on MARIO main form. | ||
At this point you can start the analysis by | At this point you can start the analysis by clicking on the Evaluate and Plot button. | ||
[[Image:Mu Rhy8.jpg]] | [[Image:Mu Rhy8.jpg]] | ||
== View | == View Results == | ||
The first figure that appears is the R-square matrix (channels x frequency bins) | The first figure that appears is the R-square matrix (channels x frequency bins) | ||
=== R-square | === R-square Matrix === | ||
The r-square matrix highlights the most relevant spectral features for the separation of the two classes of EEG - Cursor Up (target 1) and Cursor Down (target 2). | The r-square matrix highlights the most relevant spectral features for the separation of the two classes of EEG - Cursor Up (target 1) and Cursor Down (target 2). | ||
| Line 89: | Line 86: | ||
[[Image:Mu Rhy8.jpg]] | [[Image:Mu Rhy8.jpg]] | ||
Each row of the matrix is related to a single channel, while a column represents a frequency bin (labeled with its central frequency). The color codes the statistical significance of the difference between the two | Each row of the matrix is related to a single channel, while a column represents a frequency bin (labeled with its central frequency). The color codes the statistical significance of the difference between the two kinds of evoked potentials. | ||
Thus a red color would mean that, on that channel and for that frequency, the "Up" EEG is significantly synchronized with respect to "Down" EEG. | Thus a red color would mean that, on that channel and for that frequency, the "Up" EEG is significantly synchronized with respect to "Down" EEG. | ||
| Line 95: | Line 92: | ||
Clicking on a cell of the matrix will open two more windows: | Clicking on a cell of the matrix will open two more windows: | ||
* Power spectral distribution of the selected channel | * Power spectral distribution of the selected channel | ||
* Topographic maps at the selected frequency. | * Topographic maps at the selected frequency. | ||
| Line 103: | Line 100: | ||
=== Power Spectra and Topographic Plots === | === Power Spectra and Topographic Plots === | ||
In the lower panel you can find the spectral density of power for both classes of EEG. Blue line refers to "Up" condition, while Red line to "Down". | In the lower panel you can find the spectral density of power for both classes of EEG. The Blue line refers to the "Up" condition, while the Red line refers to the "Down" condition. | ||
We can see that at the vertex the "Down" condition is generally more synchronized than the "Up", with maximal difference in the beta band, consistently with what is shown by the R-square matrix. The proportinality between spectral differences and R-square is anyway rough, since r-square is sensitive to the dispersion (variance) of single trials; thus, small differences between spectra could bring to a high r-square, if they were very reproducible. | We can see that at the vertex the "Down" condition is generally more synchronized than the "Up", with maximal difference in the beta band, consistently with what is shown by the R-square matrix. The proportinality between spectral differences and R-square is anyway rough, since r-square is sensitive to the dispersion (variance) of single trials; thus, small differences between spectra could bring to a high r-square, if they were very reproducible. | ||
The peak around 50 Hz is due to mains disturbance; this also allows to appreciate the leakage introduced by the spectral estimation. | The peak around 50 Hz is due to mains disturbance; this also allows you to appreciate the leakage introduced by the spectral estimation. | ||
[[Image:Mu_Rhy9.jpg]] | [[Image:Mu_Rhy9.jpg]] | ||
Over the spectral graph, a | Over the spectral graph, a topographic plot shows the scalp distribution of the r-square. | ||
The color coding is the same as the r-square matrix figure, and values on each channel are interpolated to create a continuous bidimensional map. The higher the number of electrodes, the more accurate is the map. | The color coding is the same as the r-square matrix figure, and values on each channel are interpolated to create a continuous bidimensional map. The higher the number of electrodes, the more accurate is the map. With Surface Laplacian spatial filtering, the number of channels shown on the scalp may not coincide with the whole number of electrodes, since the value of the laplacian is not computed on the border channels. | ||
===Interpretation of the Results=== | |||
The absolute value of R-square is mathematically bound to lie in the interval between 0 and 1. Values above 0.4 allow a rate of missed target | The first step in the preliminary analysis of P300 BCI data is to find the absolute maximum of r-square. This simple statement must be mediated with a proper knowledge of physiological phenomena. In fact, we do not expect any sensorimotor activity at 3 Hz, so if the absolute maximum is at that frequency, you must suspect that it is actually an artifact. The same holds true if the spatial localization of the peak is far away from the centro-parietal electrodes. | ||
From a practical point of view, it is not important, now, to understand the reasons that different components explain the desynchronization peak on Cz at 17 Hz, so long as we are confident that this component is stable enough to be exploitable during the next session to control the cursor. | |||
The absolute value of R-square is mathematically bound to lie in the interval between 0 and 1. Values above 0.4 allow a rate of missed target on the order of a few percent. Values around 0.1 are promising. Values below 0.03 are possibly due to random fluctuations. All the previous figures refer to analyses made on 240 trials. | |||
''<b>Beware of artifacts!</b>'' | ''<b>Beware of artifacts!</b>'' | ||
During the acquisition, you should be particularly careful to avoid artifacts. While EOG and blink artifacts are confined to very low frequencies, EMG artifacts are mostly on the beta band and could largely overlap with the frequency band that | During the acquisition, you should be particularly careful to avoid artifacts. While EOG and blink artifacts are confined to very low frequencies, EMG artifacts are mostly on the beta band and could largely overlap with the frequency band that characterizes the mu rhythm. | ||
If contaminated data was acquired, then you have two problems: | If contaminated data was acquired, then you have two problems: | ||
:* Realize that EMG is superimposed to data | :* Realize that EMG is superimposed on the to data | ||
:* Distinguish between spectral modulation introduced by EEG and by EMG | :* Distinguish between spectral modulation introduced by EEG and by EMG | ||
The first task is not as trivial as it might appear. If you did not acquire the data yourself (or even if you did | The first task is not as trivial as it might appear. If you did not acquire the data yourself (or even if you did) you might complete the analysis procedure without giving a single glance to the raw data. So you must be particularly careful when you analyze the R-square maps, and always check if the peak you are seeing might be due to an artifact. | ||
Discriminant features between EEG and EMG are both in the frequency distribution and in the spatial distribution. | Discriminant features between EEG and EMG are both in the frequency distribution and in the spatial distribution. | ||
EMG that strongly affects the recordings is mostly generated by muscles at the forehead or close to the ears/jaws. Thus, their spatial distribution is such that the most responsive channel is one of those at the border of the montage. Of course, due to volume conduction, the effects can be seen even on electrodes on the opposite part of the montage, but they show a degrading pattern. | |||
EMG that strongly affects the recordings is mostly generated by muscles at the forehead or close to the ears/jaws. Thus their spatial distribution is such that the most responsive channel is one of those at the border of the montage. Of course, due to volume conduction, the effects can be seen even on electrodes on the opposite part of the montage, but they show a degrading pattern. | |||
On the other hand, a peak that shows its maximum on a central channel, can hardly be generated by a muscle or by other non-cephalic source. | On the other hand, a peak that shows its maximum on a central channel, can hardly be generated by a muscle or by other non-cephalic source. | ||
The spectrum of EEG is mainly concentrated in the alpha band, with a possible flatter and lower peak in beta. With the exception of the beta peak/plateau, the EEG spectrum decreases almost linearly (if measured in dB) after 12 Hz. | The spectrum of EEG is mainly concentrated in the alpha band, with a possible flatter and lower peak in beta. With the exception of the beta peak/plateau, the EEG spectrum decreases almost linearly (if measured in dB) after 12 Hz. | ||
On the other hand, EMG spectrum becomes significant at about 20 Hz and is still very high at the highest frequencies we usually analyze (60 Hz). A spectrum with a pattern more similar to the latter, | On the other hand, the EMG spectrum becomes significant at about 20 Hz and is still very high at the highest frequencies we usually analyze (60 Hz). A spectrum with a pattern more similar to the latter, may indicate that non-EEG activity is present in the data. | ||
==Improving the | ==Improving the Analysis== | ||
The first cause of an unsuccessful analysis is | The first cause of an unsuccessful analysis is poor quality of the recording. For this reason it is highly recommended that, at least for the first experiments, the subject be highly motivated and cooperative. If this is the case, data of low quality are usually present in one or a few runs. And if the experimenter is careful enough, he/she should have noted the occurrence of strong artifacts on the run sheet. | ||
In this | In this case, the next step is to repeat an unsatisfactory data analysis after having excluded the (putative) bad runs. | ||
To do this, just go back to the file selection dialog, choose LOAD Data again and load only the runs that you believe are clean. The number of runs should not be too low (as a rule of thumb, the data set should contain at least 100 trials), otherwise the r-square statistical analysis would loose sensitivity. | To do this, just go back to the file selection dialog, choose LOAD Data again and load only the runs that you believe are clean. The number of runs should not be too low (as a rule of thumb, the data set should contain at least 100 trials), otherwise the r-square statistical analysis would loose sensitivity. | ||
| Line 150: | Line 148: | ||
The screening experiment is not different from a regular training session, from the point of view of data format. You will have four sets (horizontal movement, horizontal imagination, vertical movement, and vertical imagination) of three runs, containing EEG acquired in two conditions (up and down, or left and right). | The screening experiment is not different from a regular training session, from the point of view of data format. You will have four sets (horizontal movement, horizontal imagination, vertical movement, and vertical imagination) of three runs, containing EEG acquired in two conditions (up and down, or left and right). | ||
Start analyzing the vertical movement execution, and mark a few possible responsive features. The analysis on vertical movement imagination should confirm (though with a lower R-square) those that are actually related to sensorimotor cognitive states. | Start analyzing the vertical movement execution, and mark a few possible responsive features. The analysis on the vertical movement imagination should confirm (though with a lower R-square) those that are actually related to sensorimotor cognitive states. | ||
In the | In the case that no reliable responsive EEG feature is found, the analysis can be repeated on the horizontal dataset. | ||
If both the vertical and horizontal dataset show responsive features, and these are different, the subject should be trained for | If both the vertical and horizontal dataset show responsive features, and these are different, the subject should be trained for several sessions on vertical training until he/she decreases the error rate below 10%. At that point, the training of the horizontal modulation can begin, with the aim that, the subject will eventually control both the vertical and the horizontal simultaneously in a two-dimensional task. | ||
==Conclusions== | ==Conclusions== | ||
If you are confident that you have found a significant difference between conditions | If you are confident that you have found a significant difference between conditions that is due to EEG rather than an artifact, and that reflects a cognitive process that is likely to be reproduced (or even enhanced with training) in the next session, you have reached your goal. | ||
The next time the same subject practices with the D2Box Application, you will have to change the MUD matrix so that it reflects the feature that you just outlined. | |||
==Troubleshooting== | ==Troubleshooting== | ||
| Line 167: | Line 165: | ||
[[Image:Defective.jpg]] | [[Image:Defective.jpg]] | ||
Matlab customers can | Matlab customers can get around this problem using this simple procedure: | ||
:* Select the defective figure window | :* Select the defective figure window | ||
:* Go to the Matlab Command Window | :* Go to the Matlab Command Window | ||
:* Execute one of the following command line: | :* Execute one of the following command line: | ||
:**set(gcf, 'Renderer', 'Painters') | :**set(gcf, 'Renderer', 'Painters') | ||
:**set(gcf, 'Renderer', 'zbuffer'). | :**set(gcf, 'Renderer', 'zbuffer') | ||
The figure will be a plot using a different renderer (Painters or zBuffer). | |||
[[Category:MARIO]] | |||
[[Category:Matlab]] | |||
[[Category:Data Analysis Tools]] | |||
[[Category:Tutorial]] | |||
Revision as of 11:30, 14 July 2008
Starting an Analysis Session
Every recording session has its own history. It is very difficult to say in advance what might happen during the recording. So we will assume that everything was perfect (the subject collaborated, no channel went lost, etc); later on we will consider the main causes of contamination, how to recognize it and what to do.
If the recording session runs smoothly, you should now have in the folder \TestData\Data\Mu, two files named ALFAS006R01.dat and ALFAS006R02.dat, corresponding to two of the eight runs usually recorded, respectively.
Before you start the analysis you should locate the correct montage file on your hard disk. This is a file that describes the list of channels that were acquired. In this tutorial we will use Complete_Montage(suggested choice).mmf, which is located in the folder \TestData\Montage. If you need to edit the *.mmf file, check its data format.
Opening Files with Mario
After having run mario.exe, press "Select Data Files".
A dialog window will ask you to select the dat files. You can either select a single data file, or select multiple files. This time, we will select all files in the dataset.
A green box will surround the Raw Data box in the main window.
As an optional (but recommended) operation, click on the LOAD MONTAGE button and choose the mmf file. This will allow you to see the labels of each channel and allow you to apply spatial filters that depend on the electrode position.
You can load an additional parameters file with choices different from those used during the experiment.
At this point, you can check that Mu is selected in the Analysis menu (indicating that a Mu dataset has been recognized) and click on the LOAD DATA button to confirm your choices. This will enable the EDIT CHANNEL LIST button that you can use to select the channels you want to include in your analysis.
Selecting Channels
When you select the EDIT CHANNEL LIST button, two forms will show you the channel list (valid ones and not-valid ones) and an image showing valid channels and their location.
Clicking on Add and Remove buttons allows you to move a channel from one list to the other, enabling or disabling it.
Selecting the Spatial Filter
Return to the main window, and you can choose which filter to apply for your analysis, selecting from the following filter choices:
- RAW
- CAR
- Large Laplacian
- Small Laplacian
Common Average Reference (CAR) will be fine for most of the situations.
We hope, soon, to release a user defined solution for any custom analysis.
Feature Extraction Analysis
The Analysis field in the Feature Extraction panel will appear automatically according to the files loaded, while the Feature Extractor field shows the only currently possible choice.
You can view/edit analysis details by clicking on "Set Analysis Details" and "Set F.E. parameters"
This second form reports all the settings for the parametric (autoregressive) spectral estimation stage. Most of the values are set after the corresponding values used on-line (see BCI2000 setup for Mu). Using the settings in the figure, the analysis software will:
- analyze data recorded at 200 Hz sampling rate
- remove the mean value
- sample the spectrum at points starting from 0 Hz to 60 Hz, every 0.2 Hz.
- Identify an auroregressive model of order 16
- average these values into 2 Hz wide bins
- take a 1 s long epoch of data
You can modify these settings according to your aims. Changing the model order, for instance, brings sometimes to interesting results. Remember though that in the online version, spectral estimation is performed in epochs as short as 200 ms (i.e. 40 samples, at 200 Hz sampling rate), so you should avoid using a model order higher than half the samples available in the epoch. When you are finished, remember to confirm your choices by slecting DONE.
In addition, a button in the Spectral Extimation frame allows you to revert to the original values.
Altogether you have to specify:
- which data (in each trial) you want to take into account. Mu will only use the part of the trial when the cursor is visible, while MuExtended will take into account all the period when the target is visible. To learn more, see section D2Box Application States
- If you have made an artifact rejection (or noted on the run sheet during the acquisition which trials contain artifacts), you can instruct the software not to use them
- Finally, you must decide how the software must extract EEG epochs from the continuous data
The epochs can be partially overlapped. This attenuates the data loss in case the length of a trial is not a multiple of the length of an epoch.
The percentage of overlap can be set both in Mario GUI and in any batch script. It is equal to the value of the MU_params.overlapping variable and the corresponding GUI field can be found by clickiing on Set Analysis Details on MARIO main form.
At this point you can start the analysis by clicking on the Evaluate and Plot button.
View Results
The first figure that appears is the R-square matrix (channels x frequency bins)
R-square Matrix
The r-square matrix highlights the most relevant spectral features for the separation of the two classes of EEG - Cursor Up (target 1) and Cursor Down (target 2).
Each row of the matrix is related to a single channel, while a column represents a frequency bin (labeled with its central frequency). The color codes the statistical significance of the difference between the two kinds of evoked potentials.
Thus a red color would mean that, on that channel and for that frequency, the "Up" EEG is significantly synchronized with respect to "Down" EEG.
Clicking on a cell of the matrix will open two more windows:
- Power spectral distribution of the selected channel
- Topographic maps at the selected frequency.
You can choose whether to overwrite or to put the most recently evoked figures beside the previous one. Two sets of waveform/topography figures are available, and are linked to the click of the left, the central or right mouse button. Left Button will create/overwrite a first figure, Right Button will do the same on a second figure, the Central Button will always open a new plot.
Power Spectra and Topographic Plots
In the lower panel you can find the spectral density of power for both classes of EEG. The Blue line refers to the "Up" condition, while the Red line refers to the "Down" condition. We can see that at the vertex the "Down" condition is generally more synchronized than the "Up", with maximal difference in the beta band, consistently with what is shown by the R-square matrix. The proportinality between spectral differences and R-square is anyway rough, since r-square is sensitive to the dispersion (variance) of single trials; thus, small differences between spectra could bring to a high r-square, if they were very reproducible.
The peak around 50 Hz is due to mains disturbance; this also allows you to appreciate the leakage introduced by the spectral estimation.
Over the spectral graph, a topographic plot shows the scalp distribution of the r-square.
The color coding is the same as the r-square matrix figure, and values on each channel are interpolated to create a continuous bidimensional map. The higher the number of electrodes, the more accurate is the map. With Surface Laplacian spatial filtering, the number of channels shown on the scalp may not coincide with the whole number of electrodes, since the value of the laplacian is not computed on the border channels.
Interpretation of the Results
The first step in the preliminary analysis of P300 BCI data is to find the absolute maximum of r-square. This simple statement must be mediated with a proper knowledge of physiological phenomena. In fact, we do not expect any sensorimotor activity at 3 Hz, so if the absolute maximum is at that frequency, you must suspect that it is actually an artifact. The same holds true if the spatial localization of the peak is far away from the centro-parietal electrodes.
From a practical point of view, it is not important, now, to understand the reasons that different components explain the desynchronization peak on Cz at 17 Hz, so long as we are confident that this component is stable enough to be exploitable during the next session to control the cursor.
The absolute value of R-square is mathematically bound to lie in the interval between 0 and 1. Values above 0.4 allow a rate of missed target on the order of a few percent. Values around 0.1 are promising. Values below 0.03 are possibly due to random fluctuations. All the previous figures refer to analyses made on 240 trials. Beware of artifacts!
During the acquisition, you should be particularly careful to avoid artifacts. While EOG and blink artifacts are confined to very low frequencies, EMG artifacts are mostly on the beta band and could largely overlap with the frequency band that characterizes the mu rhythm.
If contaminated data was acquired, then you have two problems:
- Realize that EMG is superimposed on the to data
- Distinguish between spectral modulation introduced by EEG and by EMG
The first task is not as trivial as it might appear. If you did not acquire the data yourself (or even if you did) you might complete the analysis procedure without giving a single glance to the raw data. So you must be particularly careful when you analyze the R-square maps, and always check if the peak you are seeing might be due to an artifact.
Discriminant features between EEG and EMG are both in the frequency distribution and in the spatial distribution.
EMG that strongly affects the recordings is mostly generated by muscles at the forehead or close to the ears/jaws. Thus, their spatial distribution is such that the most responsive channel is one of those at the border of the montage. Of course, due to volume conduction, the effects can be seen even on electrodes on the opposite part of the montage, but they show a degrading pattern. On the other hand, a peak that shows its maximum on a central channel, can hardly be generated by a muscle or by other non-cephalic source.
The spectrum of EEG is mainly concentrated in the alpha band, with a possible flatter and lower peak in beta. With the exception of the beta peak/plateau, the EEG spectrum decreases almost linearly (if measured in dB) after 12 Hz. On the other hand, the EMG spectrum becomes significant at about 20 Hz and is still very high at the highest frequencies we usually analyze (60 Hz). A spectrum with a pattern more similar to the latter, may indicate that non-EEG activity is present in the data.
Improving the Analysis
The first cause of an unsuccessful analysis is poor quality of the recording. For this reason it is highly recommended that, at least for the first experiments, the subject be highly motivated and cooperative. If this is the case, data of low quality are usually present in one or a few runs. And if the experimenter is careful enough, he/she should have noted the occurrence of strong artifacts on the run sheet. In this case, the next step is to repeat an unsatisfactory data analysis after having excluded the (putative) bad runs. To do this, just go back to the file selection dialog, choose LOAD Data again and load only the runs that you believe are clean. The number of runs should not be too low (as a rule of thumb, the data set should contain at least 100 trials), otherwise the r-square statistical analysis would loose sensitivity.
Analyzing the Screening
The screening experiment is not different from a regular training session, from the point of view of data format. You will have four sets (horizontal movement, horizontal imagination, vertical movement, and vertical imagination) of three runs, containing EEG acquired in two conditions (up and down, or left and right).
Start analyzing the vertical movement execution, and mark a few possible responsive features. The analysis on the vertical movement imagination should confirm (though with a lower R-square) those that are actually related to sensorimotor cognitive states.
In the case that no reliable responsive EEG feature is found, the analysis can be repeated on the horizontal dataset.
If both the vertical and horizontal dataset show responsive features, and these are different, the subject should be trained for several sessions on vertical training until he/she decreases the error rate below 10%. At that point, the training of the horizontal modulation can begin, with the aim that, the subject will eventually control both the vertical and the horizontal simultaneously in a two-dimensional task.
Conclusions
If you are confident that you have found a significant difference between conditions that is due to EEG rather than an artifact, and that reflects a cognitive process that is likely to be reproduced (or even enhanced with training) in the next session, you have reached your goal. The next time the same subject practices with the D2Box Application, you will have to change the MUD matrix so that it reflects the feature that you just outlined.
Troubleshooting
Some OpenGL drivers may sometimes show defective figures like the following:
Matlab customers can get around this problem using this simple procedure:
- Select the defective figure window
- Go to the Matlab Command Window
- Execute one of the following command line:
- set(gcf, 'Renderer', 'Painters')
- set(gcf, 'Renderer', 'zbuffer')
The figure will be a plot using a different renderer (Painters or zBuffer).



