资源简介
matlab开发-EMGONOFF。找到“开”和“关”表示一个原始表面肌电爆发(肌肉收缩)。
代码片段和文件信息
function onoff = emgonoff(rawemg fs ws sd)
% EMGONOFF - Find on/off times and indicies of raw EMG data.
% Calculate average(mean) value of resting EMG
% Define “on“ EMG as the sample where average value of EMG in a given window
% range around the sample is a given # of std. dev. above avg. resting EMG.
%
% onoff = emgonoff(rawemg fs ws sd)
%
% Use the mouse to select two ranges of “resting“ EMG from a graph of the
% full-wave rectified EMG data. Click four times: start and end of 1st
% resting range and start and end of 2nd resting range. Mouse clicks need
% to be consecutive and in order of increasing time (i.e. left-to-right on
% the graph). The first range should precede the EMG burst associated with
% the muscle contraction under consideration. The sedond range should be
% the resting EMG data immediately following the EMG burst.
%
% rawemg = input file raw emg data (1-column vector)
% fs = sampling rate of raw EMG data in Hz
% ws = window size in milliseconds (50ms @ 2400Hz = 120 samples)
% sd = number of std. deviations above resting rms emg to trigger an “ON“
% Default values:
% ws = 50ms
% sd = 1
% Algorythm for EMG onset & offset taken from
% Hodges P.W. and B.H. Bui _A comparison of computer-based methods for
% the determination of onset of muscle contraction using electromyography._
% Electroencephalography & Clinical Neurophysiology 1996. 101(6): p. 511-9
%
% Created by: Kieran A. Coghlan BSME MSES
% SUNY at Buffalo New York
%
% Last modified: 1 May 2006
%% Check inputs for defaults
if nargin < 2 error(‘Not enough inputs. Type “help emgonoff“ for help.‘); end
if nargin < 3 ws = 50; end
if nargin < 4 sd = 1; end;
%% Full-Wave-Rectify the raw data
fwlo = abs(rawemg(:1));
%% prepare for loop
% Get two ranges for resting emg (before & after burst) using ginput
R = input(‘\nUse the mouse to select FOUR points to define the begining and \nend of two data ranges that will be used to calculate average\nresting EMG values before and after the EMG burst (muscle contraction)\nPress [RETURN] to begin: ‘);
clear R;
f1 = figure;
plot(fwlo);
[x y] = ginput(4); %click four times: two for start/end of resting emg before burst two for resting emg after burst
x = round(x);
clear y;
%close(f1);clear f1; % Leave commented if you want to keep EMG graph up to
% % do a visual QA of on/off results.
%% preallocate arrays
mvgav = zeros(x(4)-x(1)1);
onoff(11) = 0;
i=0;
restav = mean(fwlo(x(1):x(2))); %average value of rest EMG before ON
reststd = std(fwlo(x(1):x(2))); %std. dev. of rest EMG before ON
restav2 = mean(fwlo(x(3):x(4))); %average value of rest EMG after OFF
reststd2 = std(fwlo(x(3):x(4))); %std. dev. of rest EMG after OFF
%% window size (in samples) = ws*fs e.g. 50ms*2400Hz = 120 samples
sws2 = fs*(0.001*ws);
sws = 0.5*(sws2);
sws = round(sws);
%% find “ON“ index:
% for xi change from x(1) to x(2) if you want to
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3677 2018-07-11 20:24 emgonoff.m
- 上一篇:matlab开发-MeshLBP
- 下一篇:matlab开发-othellom
相关资源
- matlab开发-othellom
- matlab开发-级联H桥多电平转换三相
- matlab开发-带图形用户界面的步进电机
- matlab开发-MFTireGUI
- matlab开发-自适应霍夫曼编码技术字符
- matlab开发-ConnectFour
- matlab开发-floodfillscanline
- matlab开发-Paretosurfacenavigator
- matlab开发-分步序达尔文粒子群优化
- matlab开发-改进的解决方案经济调度方
- matlab开发-为Resnet50网络设计工具箱模
- matlab开发-sigmoid
- matlab开发-同步发电机的详细模型,包
- matlab开发-多层反向传播神经网络
- matlab开发-Parrotminirones的模拟支持包
- matlab开发-nnsysid
- matlab开发-使用gnewton-raphson方法查找任
- matlab开发-UR5控制Matlab
-
matlab开发-mssamultiob
jectivesalpswarmalg - matlab开发-Vasicek
- matlab开发-直流到全桥逆变器
- matlab开发-使用xFoiland ParseCGeometric参数
- matlab开发-如何模拟6到10个输入状态空
- matlab开发-mtype340
- matlab开发-rafaelaeroXFOILinterface
-
matlab开发-单相三电平去阻尼Pwmba
s - matlab开发-scatter3sph
- matlab开发-TraCI4Matlab
- matlab开发-三个27电平转换器,带有单
- matlab开发-DynaSimDynaSim
评论
共有 条评论