【肌电信号】基于matlab GUI肌电信号处理【含Matlab源码 966期】
【摘要】
一、简介
肌电信号又称为EMG;EMG(electromyography)是一种生物电流信号,它产生于任意组织器官,一般是一种时间和一系列的振幅、频率和波形函数 。肌电信号是伴随肌肉收缩动作产生的一种生...
一、简介
肌电信号又称为EMG;EMG(electromyography)是一种生物电流信号,它产生于任意组织器官,一般是一种时间和一系列的振幅、频率和波形函数 。肌电信号是伴随肌肉收缩动作产生的一种生物电信号,采集皮肤表面的肌电信号称为表面肌电信号sEMG。
sEMG信号是人体表面肌肉通过收缩产生的生物电流。 神经系统控制肌肉的活动(收缩或者放松),在表面皮肤不同的肌肉纤维运动单元在同一时间产生相互不同的信号。
肌电信号的产生
表面肌电信号是由多个运动单元发放的动作电位序列,在皮肤表面呈现的时间和空间上综合叠加的结果;
肌电信号的特点
(1)sEMG是一维时间动作电位序列
(2)sEMG是交流信号,幅值一般和肌肉运 动力度成正比
(3)sEMG是一种非平稳的微电信号,其幅值在 0~1.5mv,有用信号频率位于 0~500HZ,主要能量集中在 20~150HZ
(4)SEMG一般比肢体运动超前 30~150ms产生,可以进行运动提前判断
二、源代码
function varargout = bishe1(varargin)
% BISHE1 MATLAB code for bishe1.fig
% BISHE1, by itself, creates a new BISHE1 or raises the existing
% singleton*.
%
% H = BISHE1 returns the handle to a new BISHE1 or the handle to
% the existing singleton*.
%
% BISHE1('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in BISHE1.M with the given input arguments.
%
% BISHE1('Property','Value',...) creates a new BISHE1 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before bishe1_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to bishe1_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
% Edit the above text to modify the response to help bishe1
% Last Modified by GUIDE v2.5 25-May-2021 12:43:46
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @bishe1_OpeningFcn, ...
'gui_OutputFcn', @bishe1_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 bishe1 is made visible.
function bishe1_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 bishe1 (see VARARGIN)
% Choose default command line output for bishe1
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes bishe1 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = bishe1_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 during object creation, after setting all properties.
function axes2_CreateFcn(hObject, eventdata, handles)
% hObject handle to axes2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: place code in OpeningFcn to populate axes2
% --- Executes during object creation, after setting all properties.
function axes1_CreateFcn(hObject, eventdata, handles)
% hObject handle to axes1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: place code in OpeningFcn to populate axes1
% --- Executes during object creation, after setting all properties.
function axes3_CreateFcn(hObject, eventdata, handles)
% hObject handle to axes3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: place code in OpeningFcn to populate axes3
% --- Executes during object creation, after setting all properties.
function axes4_CreateFcn(hObject, eventdata, handles)
% hObject handle to axes4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: place code in OpeningFcn to populate axes4
% --- Executes on button press in pushbutton6.
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
selection=questdlg(['是否关闭',get(gcf,'Name'),'这个面板?'], ...
['Close ',get(gcf,'Name'),'...'],'是','否','是');%当选择退出按钮时,得出一个问是否确定关闭的框
if strcmp(selection,'否')
return;
else
clc; %当选择关闭时,清空所有matla输入面上的所有错误信息,同时关闭图像窗口
clear all;
delete(gcf);
end
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A=load('1.txt');
global Q;
switch Q
case 1
s=A(30001:35000,2);
case 2
s=A(35001:40000,2);
case 3
s=A(40001:45000,2);
case 4
s=A(45001:50000,2);
case 5
s=A(50001:55000,2);
case 6
s=A(55001:60000,2);
end
fs=1; %采样频率
N=5000; %采样点数
n=0:N-1;
t=n/fs; %时间
axes(handles.axes1);
plot(t,s);
title('输入信号');xlabel('t/s');ylabel('幅度'); %时域波形
grid on
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A=load('1.txt');
global Q;
switch Q
case 1
s=A(30001:35000,2);
case 2
s=A(35001:40000,2);
case 3
s=A(40001:45000,2);
case 4
s=A(45001:50000,2);
case 5
s=A(50001:55000,2);
case 6
s=A(55001:60000,2);
end
fs=1; %采样频率
N=5000; %采样点数
n=0:N-1;
t=n/fs; %时间
sfft=fft(s); %傅里叶变换
axes(handles.axes2);
plot((1:length(sfft)/2)*fs/length(sfft),2*abs(sfft(1:length(sfft)/2))/length(sfft));
title('信号频谱');xlabel('频率/Hz');ylabel('幅度');
grid on %未滤波时 频域波形
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A=load('1.txt');
global Q;
switch Q
case 1
s=A(30001:35000,2);
case 2
s=A(35001:40000,2);
case 3
s=A(40001:45000,2);
case 4
s=A(45001:50000,2);
case 5
s=A(50001:55000,2);
case 6
s=A(55001:60000,2);
end
fs=1; %采样频率
N=5000; %采样点数
n=0:N-1;
t=n/fs; %时间
axes(handles.axes3);
c = rceps(s); %做倒谱图
plot(t,c);
title('信号倒谱');xlabel('频率/Hz');ylabel('幅度');
grid on
% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A=load('1.txt');
global Q;
switch Q
case 1
s=A(30001:35000,2);
case 2
s=A(35001:40000,2);
case 3
s=A(40001:45000,2);
case 4
s=A(45001:50000,2);
case 5
s=A(50001:55000,2);
case 6
s=A(55001:60000,2);
end
fs=1; %采样频率
N=5000; %采样点数
n=0:N-1;
t=n/fs; %时间
sfft=fft(s); %傅里叶变换
sF=s;
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166
- 167
- 168
- 169
- 170
- 171
- 172
- 173
- 174
- 175
- 176
- 177
- 178
- 179
- 180
- 181
- 182
- 183
- 184
- 185
- 186
- 187
- 188
- 189
- 190
- 191
- 192
- 193
- 194
- 195
- 196
- 197
- 198
- 199
- 200
- 201
- 202
- 203
- 204
- 205
- 206
- 207
- 208
- 209
- 210
- 211
- 212
- 213
- 214
- 215
- 216
- 217
- 218
- 219
- 220
- 221
- 222
- 223
- 224
- 225
- 226
- 227
- 228
- 229
- 230
- 231
- 232
- 233
- 234
- 235
- 236
- 237
- 238
- 239
- 240
- 241
- 242
三、运行结果
四、备注
版本:2014a
文章来源: qq912100926.blog.csdn.net,作者:海神之光,版权归原作者所有,如需转载,请联系作者。
原文链接:qq912100926.blog.csdn.net/article/details/117468803
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)