How to determine muscle activation timing of an emg signal?

14 vues (au cours des 30 derniers jours)
Enrica Brunetti
Enrica Brunetti le 10 Sep 2020
Réponse apportée : MarKf le 27 Nov 2022
Are there any matlab toolboxes to determine onset and offset of an emg signal in order to evaluate muscle activation timing?
  1 commentaire
H W
H W le 26 Nov 2022
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');

Connectez-vous pour commenter.

Réponses (1)

MarKf
MarKf le 27 Nov 2022
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