Author: riken_admin

Corticospinal Decoding from EEG

Last update: 2020.08.21 10:10 |
Post: 2020.08.21 10:10

General Description

The following algorithm computes a corticospinal decoding of motor primitives from EEG signals after applying a cross-validation (one-file out) with all the recording input files.

Data format

Data fields description:

  • data.EEG – contains a matrix with filtered EEG signals after artifact removal from all 16 recorded channels (27 seconds)
  • data.EMG – contains a matrix with processed EMG signals (rectification and linear envelope) from the 3 recorded muscles (27 seconds)
  • data.W – contains the weights of the extracted synergy for each muscle
  • data.H – contains the non-negative signal from the extracted synergy (27 seconds)
  • data.info – contains additional information of the recordings
  • data.info.fm – Shared sample frequency for all the recorded data
  • data.info.subject – ID of the subject (in this case a default subject ‘A00’)
  • data.info.emg_channels – Names of the recorded EMG channels
  • data.info.eeg_channels – Names of the recorded EEG channels

This data set does not contain original recorded EEG and EMG data. EEG and EMG processing and filtering can be changed freely as long as final processed data follows this structure. However, EEG and EMG number of channels, number of computed synergies and recording duration can change depending on the research purpose.

Sample Materials

Sample Data Description

The sample data set consists of 6 files containing recordings of 16 EEG channels and 1 extracted muscle synergy during a periodical knee flexion and extension. Recorded EEG channels are FP1, FZ, FC1, FC2, C3, C1, CZ, C2, C4, CP1, CP2, PZ, FC3, FCZ, FC4 and CPZ. Recorded EMG channels are Rectus Femoris, Vastus Lateralis and Vastus Medialis. This is a modified sample from the dataset used in Ubeda et al., 2018.

Script description

% Description: this script computes multidimensional linear regression
% models to decode individual muscle primitives from EEG signals
% Matlab Version R2019a, running on Windows10
% Input: EEG/EMG/Synergy files (see data set description)
% Output: Decoding models and correlations
% Author: Andres Ubeda, Human Robotics Group, University of Alicante, Spain
% Last update: 4 Aug 2020

% Decoding parameters
parameters.F=1200; parameters.L=10; % Lag
parameters.G=300; % Gap
parameters.F=1200; % Sample frequency of sync EEG/Motor Primitives recordings
parameters.E=1:16; % All EEG channels (adapt to your own EEG cap configuration)
parameters.N=length(parameters.E); % Number of selected channels
parameters.MS=1; % Select the motor primitive to decode

% Main script
Script_Decode_Main_MS

% Example of decoded motor primitive versus original motor primitive
plot((1:length(corr.A_real(end,:)))/parameters.F,corr.A_real(end,:))
hold
plot((1:length(corr.A_decoded(end,:)))/parameters.F,corr.A_decoded(end,:),’r’)
xlabel(‘Time (in seconds)’)
title(‘Decoded Primitive vs Original Primitive’)

Running the script: Step-by-Step

This script computes a corticospinal decoding of motor primitives from EEG signals after applying a cross-validation (one-file out) with all the recording input files. To execute it, initial decoding parameters of the process must be selected and modified in the script “CSDecoding.mat”:

Parameters.L – is the number of lags of the decoding window (see figure below)
Parameters.G – is the gap (in time samples) of the decoding window (see figure below)

For more info about the decoding process check Ubeda et al., 2018

Parameters.G – is the gap (in time samples) of the decoding window (see figure below)
Parameters.E – are the selected EEG channels used in the corticospinal decoded. A couple of examples:

  • 1:16 – selects all 16 channels
  • [1 3 7 9 13] – selects 5 particular channels

Parameters.N – is the number of selected EEG channels (do not change)
Parameters.MS – is the selected motor primitive to decode. A couple of examples:

  • 1 – selects the first extracted motor primitive
  • 3 – selects the third extracted motor primitive

If the number selected is not present, i.e. there is a fewer number of muscle synergies, the scripts shows an error. This script can be included in a loop to decode multiple extracted motor primitives at the same time.

After modifying the initial parameters, execute de script “CSDecoding.mat” and you will be asked for the input data files. Select two or more files and the script will automatically compute corticospinal decoding for each fold and save the results in a mat file. The script also includes a simple plotting of the original and decoded muscle primitive of a particular fold:

References

A. Ubeda, J.M. Azorin, D. Farina and M. Sartori, “Estimation of Neuromuscular Primitives from EEG Slow Cortical Potentials in Incomplete Spinal Cord Injury Individuals for a New Class of Brain-Machine Interfaces”, Frontiers in Computational Neuroscience, vol. 12, 2018. doi: 10.3389/fncom.2018.00003

Smart sEMG Averaging prior to synergy extraction

Author: riken_admin
Last update: 2020.11.13 10:45

General description The following algorithm includes code for the segmentation of independant muscle activation from sEMG data recorded during periodic tasks. Technical details were published here. The code requires a priori segmentation of the individual muscle activation on each channel. In the following lines, a sample script will be run using test data. Details about […]

Corticospinal Decoding from EEG

Author: riken_admin
Last update: 2020.08.21 10:10

General Description The following algorithm computes a corticospinal decoding of motor primitives from EEG signals after applying a cross-validation (one-file out) with all the recording input files. Data format Data fields description: data.EEG – contains a matrix with filtered EEG signals after artifact removal from all 16 recorded channels (27 seconds) data.EMG – contains a […]

Leave a Reply

Your email address will not be published.
*
*