How to determine muscle activation timing of an emg signal?

18 次查看(过去 30 天)
Are there any matlab toolboxes to determine onset and offset of an emg signal in order to evaluate muscle activation timing?
  1 个评论
H W
H W 2022-11-26
Biceps = [10 : 35];
Triceps = [100 : 200];
figure;
polarplot(Biceps*pi/180, 0.7*ones(size(Biceps)), 'y', 'LineWidth',1.5);
hold on;
polarplot(Triceps*pi/180, 0.5*ones(size(Triceps)), 'g', 'LineWidth',1.5);
hold off;
set(gca,'ThetaZeroLocation','bottom', 'RLim',[0 1]);
legend('Biceps', 'Triceps', 'Location','NorthEastOutside');

请先登录,再进行评论。

回答(1 个)

MarKf
MarKf 2022-11-27
You can use Fieldtrip or something like below (code needs testing/cleaning)
% emg = timeseries;
% Fs = sampling frequency
% Fn = Nyquist frequency, Fs/2;
% filter, hilbert and boxcar
[B, A] = butter(6, 10/Fn, 'high'); % 6th order butterw 10hz highpassfilter
emgflt = filtfilt(B, A, emg); % twopass
emghlb = abs(hilbert(emgflt)); % hilbert transform
emgcnv = conv2([1], ones(1,Fs), emghlb, 'same'); % smooth using convolution
emgstd = (emgcnv - repmat(mean(emgcnv), 1, length(emgcnv))) ./ ...
repmat(std(emgcnv), 1, length(emgcnv)); % z-transform
emgtrl = emgstd>0; % detect the muscle activity
emgtrl = diff(emgtrl, [], 2);
emgon = find(emgtrl(:)== 1);
emgoff = find(emgtrl(:)==-1);

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by