Processing EMG data in MATLAB?

161 次查看(过去 30 天)
Hi all,
I am VERY new to MATLAB, so please excuse my ignorance if this is a very novice problem. I am analysing EMG signals, I have imported from my data from xlsx as time (X) and voltage (y).
After extracting data;
set(0, 'defaultFigureToolbar', 'none')
% RAW_DATA_EXTRACTION
%% BACK_SQUAT
%%% VISIT_ONE
T1_10rm_BS_1 = xlsread('T1_70%_10rm_BS_1.xlsx','Sheet3','A5:E77494');
time = T1_10rm_BS_1(:,1);
BS_RF_1 = T1_10rm_BS_1(:,4);
BS_BF_1 = T1_10rm_BS_1(:,5);
T1_10rm_BS_2 = xlsread('T1_70%_10rm_BS_2.xlsx', 'Sheet4','A5:E78394');
time = T1_10rm_BS_2(:,1);
BS_RF_2 = T1_10rm_BS_2(:,4);
BS_BF_2 = T1_10rm_BS_2(:,5);
running filters;
%FILTER
% Lowpass filter 500Hz
Freq = 1500;
NyqFreq = Freq/2;
Lowpass = 500;
Wn = Lowpass/NyqFreq;
[B,A] = butter (4,Wn,'low');
% run filter
BS_RF_1_low_filtered = filtfilt(B,A,BS_RF_1);
BS_BF_1_low_filtered = filtfilt(B,A,BS_BF_1);
BS_RF_2_low_filtered = filtfilt(B,A,BS_RF_2);
BS_BF_2_low_filtered = filtfilt(B,A,BS_BF_2);
% Highpass filter 10Hz
Highpass = 10;
Wo = Highpass/NyqFreq;
[D,C] = butter (4,Wo,'high');
% run filter
high_pass_BS_RF_1_filtdata = filtfilt(D,C,BS_RF_1_low_filtered);
high_pass_BS_BF_1_filtdata = filtfilt(D,C,BS_BF_1_low_filtered);
high_pass_BS_RF_2_filtdata = filtfilt(D,C,BS_RF_2_low_filtered);
high_pass_BS_BF_2_filtdata = filtfilt(D,C,BS_BF_2_low_filtered);
% Full wave rectification of EMG
filtered_BS_RF_1 = abs(high_pass_BS_RF_1_filtdata);
filtered_BS_BF_1 = abs(high_pass_BS_BF_1_filtdata);
filtered_BS_RF_2 = abs(high_pass_BS_RF_2_filtdata);
filtered_BS_BF_2 = abs(high_pass_BS_BF_2_filtdata);
% Linear envelope (2Hz lowpass)
LP = 2;
Wp = LP/NyqFreq;
[F,E] = butter (4,Wp,'low');
linear_BS_RF_1 = filtfilt(F,E,filtered_BS_RF_1);
linear_BS_BF_1 = filtfilt(F,E,filtered_BS_BF_1);
linear_BS_RF_2 = filtfilt(F,E,filtered_BS_RF_2);
linear_BS_BF_2 = filtfilt(F,E,filtered_BS_BF_2);
and generating my plot (for BS_RF_1);
I am now struggling to try and find the area under the curve for my set of 10 repetitions.
I am looking to define mean activation and peak activation.
All constructive help welcome,
Cheers.
  4 个评论
David
David 2022-9-4
I'm also stuck in the same EMG signals assignment. Did you complete that assignment ?
If you did, can you please share the code here. It'd be very helpful.
SURYAKALA
SURYAKALA 2024-8-11
NO i also want the EMG signal for my miniproject but i did not yet have the perfect code for it if you have any EMG code please share it .its very help ful for me

请先登录,再进行评论。

采纳的回答

Aquatris
Aquatris 2020-2-25
编辑:Aquatris 2020-2-25
I think you are looking for the function cumtrapz, here is the link.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Spectral Measurements 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by