Processing EMG data in MATLAB?
154 次查看(过去 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
2022-9-4
@Tom Nickolay Hi,
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
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
2020-2-25
编辑:Aquatris
2020-2-25
I think you are looking for the function cumtrapz, here is the link.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spectral Measurements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!