[EMG signal] Based on GUI MUAP waveform [Matlab 736]

Keywords: Python MATLAB Autonomous vehicles

1, Introduction

EMG signal is easy to collect, but it is very difficult to understand and interpret the collected EMG signal. The analysis of EMG signals can enable us to understand the mechanism of force generation in muscles and how muscles produce movement. However, how to extract this information depends on the appropriate signal acquisition method.
1 EMG signal extraction process
Signal acquisition, signal conditioning and signal processing. The flow chart is shown below

2 signal acquisition
Muscle contraction can cause changes in skin surface current, which can be measured by electrodes placed on the skin surface. The area where the electrode contacts the skin is called the detection surface. The physiological data measured by surface electrode is called surface muscle current (sEMG). SEMG is the sum of MUAPTs from all active motion units measured by the electrode.

With the increase of muscle output, the number of active motor units also increases. Since many motor units are active during muscle contraction, the signals measured by the electrode come from many different motor units. The shape and amplitude of MUAP depend on the relative direction of muscle fibers and electrodes (compared with other factors). In a MUAPT, if the relative position of the electrode and the muscle fiber remains unchanged, the properties of the electrode remain unchanged, and the biochemical properties of the muscle tissue do not change, the waveform of the MUAP remains unchanged.
Some authors found 352 descriptions of electrode placement when collecting surface muscle current signals in 144 articles. Most of these methods are general, and refer to the muscle abdomen (the thicker area in the middle of the muscle), motor point (where the axon contacts the muscle fiber), or the midpoint of the muscle.

Factors affecting EMG stability include:

  1. Motor unit / tendon
  2. Other active muscles nearby
  3. Distance between active muscle fiber and measuring point
  4. Filter characteristics of electrode
  5. The relationship between the nerve region and the position of the electrode

Generally, better results can be obtained when the bipolar point electrode is placed parallel to the muscle fiber and the center distance between the two electrodes is more than 20 mm. This distance is small enough to avoid signal crosstalk, and large enough to select many motion units.

The reference electrode should be placed on the neutral tissue (the protruding part of the i.e. bone) to provide a common reference for the electrode amplifier.

3 signal conditioning
The electrode amplifier is used to reduce the electrode skin impedance.
Signal conditioning is used to further improve the quality of EMG signal.
Methods of signal conditioning include:

Filtering to reduce motion artifacts
The electrode motion artifact may come from the skin deformation under the surface electrode area or the disturbance of the electrode charge layer. The power density of motion artifact is less than 20 Hz. Therefore, the high pass filter can be used to improve the quality of the signal. The turning frequency of this filter should be between 10 Hz and 20 Hz, but not greater than 20 Hz, otherwise it will lead to the loss of EMG signal energy.
Filtering techniques for motion pseudo inverse include:

  1. 8th order Chebychev high pass filters
  2. adaptive filtering based on orthogonal Meyer wavelets
    EMG signal amplification

Pay special attention to the interference of power frequency noise.
power line interference

4 signal processing
EMG signal is used as control signal:

  • Multifunctional prosthesis
  • wheelchair
  • Grip control
  • virtual keyboard
  • Pose based control interface

5 data segmentation
EMG signals have two states:

  • Transient: muscle from rest to spontaneous contraction
  • Steady state: muscle produces constant force contraction
    Transient EMG signals are more difficult to process than steady-state EMG signals.

6 feature extraction
Time domain characteristics
EMG amplitude is related to the number of active motion units and their active level.
The methods of forming EMG amplitude are:

  • Analog correction and smoothing (low pass)
  • Mean absolute value (MAV) processing
  • Root mean square (RMS) treatment

For high-level shrinkage, Gaussian model can be used to fit EMG signal; LaPlacian can be used to fit weak muscle contraction and contraction in muscle fatigue state.
Other EMG time domain features include mean absolute value (MAVs) slope, zero crossing, slope symbol change and waveform length.

7 frequency domain characteristics
Time domain frequency domain characteristics
language for special purposes
Surface EMG (sEMG): surface EMG signal
MU (motor unit): motor unit
MUAPTs (motor unit action potential trains): action potential sequence
Motion artifact: motion artifact

2, Partial source code

function varargout = MUAPgui(varargin)
% MUAPGUI M-file for MUAPgui.fig
%      MUAPGUI, by itself, creates a new MUAPGUI or raises the existing
%      singleton*.
%
%      H = MUAPGUI returns the handle to a new MUAPGUI or the handle to
%      the existing singleton*.
%
%      MUAPGUI('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in MUAPGUI.M with the given input arguments.
%
%      MUAPGUI('Property','Value',...) creates a new MUAPGUI or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before MUAPgui_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to MUAPgui_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Copyright 2002-2003 The MathWorks, Inc.

% Edit the above text to modify the response to help MUAPgui

% Last Modified by GUIDE v2.5 27-Dec-2006 12:09:22

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @MUAPgui_OpeningFcn, ...
                   'gui_OutputFcn',  @MUAPgui_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


    % --- Executes just before MUAPgui is made visible.
function MUAPgui_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to MUAPgui (see VARARGIN)

% Choose default command line output for MUAPgui
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);
clear all;
% UIWAIT makes MUAPgui wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = MUAPgui_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on button press in Laplace.
function Laplace_Callback(hObject, eventdata, handles)
% hObject    handle to Laplace (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

global muap;
lapmuap=4*muap(2,:)-muap(1,:)-muap(3,:)-muap(4,:)-muap(5,:);
axes(handles.axes1);
HH=plot(lapmuap);
set(HH,'LineWidth',2);
clear HH;

% --- Executes on button press in Bipolar.
function Bipolar_Callback(hObject, eventdata, handles)
% hObject    handle to Bipolar (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global muap;

biomuap=muap(1,:)-muap(2,:);
axes(handles.axes2);
HH=plot(biomuap);
set(HH,'LineWidth',2);
clear HH;

% --- Executes on button press in Monopolar.
function Monopolar_Callback(hObject, eventdata, handles)
% hObject    handle to Monopolar (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

global muap;

axes(handles.axes3);
HH=plot(muap(2,:));
set(HH,'LineWidth',2);
clear HH;

function nf_Callback(hObject, eventdata, handles)
% hObject    handle to nf (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of nf as text
%        str2double(get(hObject,'String')) returns contents of nf as a double


% --- Executes during object creation, after setting all properties.
function nf_CreateFcn(hObject, eventdata, handles)
% hObject    handle to nf (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function skinfat_Callback(hObject, eventdata, handles)
% hObject    handle to skinfat (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of skinfat as text
%        str2double(get(hObject,'String')) returns contents of skinfat as a double


% --- Executes during object creation, after setting all properties.
function skinfat_CreateFcn(hObject, eventdata, handles)
% hObject    handle to skinfat (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function x_Callback(hObject, eventdata, handles)
% hObject    handle to x (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of x as text
%        str2double(get(hObject,'String')) returns contents of x as a double


% --- Executes during object creation, after setting all properties.
function x_CreateFcn(hObject, eventdata, handles)
% hObject    handle to x (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually ave a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


3, Operation results


4, matlab version and references

1 matlab version
2014a

2 references
[1] Shen Zaiyang. Proficient in MATLAB signal processing [M]. Tsinghua University Press, 2015
[2] Gao Baojian, Peng Jinye, Wang Lin, pan Jianshou. Signal and system -- Analysis and implementation using MATLAB [M]. Tsinghua University Press, 2020
[3] Wang Wenguang, Wei Shaoming, Ren Xin. MATLAB implementation of signal processing and system analysis [M]. Electronic Industry Press, 2018
[4] Xu Jie. Pulse wave signal processing based on wavelet analysis [J]. Electronic design engineering. 2013,21 (11)

Posted by alanho on Fri, 17 Sep 2021 04:53:07 -0700