Processing EMG data in MATLAB?

조회 수: 159 (최근 30일)
Tom Nickolay
Tom Nickolay 2020년 2월 25일
댓글: SURYAKALA 2024년 8월 11일
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