How to detect stride cycle of EMG with GRF data?

18 vues (au cours des 30 derniers jours)
Mario
Mario le 3 Jan 2023
Hello, I need help!!! I got 5 muscle EMG data and vertical force of left and right leg during 10 seconds of walking. The GRF was measured in 500 hz of frequency and the EMG data in 2000 hz. I need to detect in the double contact of GRF data the EMG activity of the 5 muscles. How can be done?
Thanks for the help!!!
left_right_GRF=xlsread("AC.xlsx")
5muscles_EMG=xlsread("AC_10_4km_Plot_and_Store_Rep_1.1.xls")
  2 commentaires
Star Strider
Star Strider le 3 Jan 2023
What are we supposed to do with the data?
C1 = readcell('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1250767/AC.xlsx')
T1 = 5001×11 cell array
{'subj item' } {'subj value' } {'Cal item' } {'Cal value' } {'Time (ms)'} {'LEFT_Fz (N)'} {'RIGHT_Fz (N)'} {'LEFT_Contact'} {'RIGHT_Contact'} {'Single Contact'} {'Double Contact'} {'last name' } {'CARRIEL' } {'Date' } {[21-Nov-2022]} {[ 0]} {[ 0]} {[ 896.6305]} {[ 0]} {[ 1]} {[ 1]} {[ 0]} {'first name' } {'Alfonso' } {'Time' } {[ 0.4811]} {[ 2]} {[ 0]} {[ 893.2404]} {[ 0]} {[ 1]} {[ 1]} {[ 0]} {'sex' } {'M' } {'Sampling Freq (Hz)' } {[ 500]} {[ 4]} {[ 0]} {[ 889.6016]} {[ 0]} {[ 1]} {[ 1]} {[ 0]} {'weight (kg)' } {[ 79]} {'# points' } {[ 5000]} {[ 6]} {[ 0]} {[ 885.8262]} {[ 0]} {[ 1]} {[ 1]} {[ 0]} {'height (cm)' } {[ 165.3000]} {'start trigger' } {'yes' } {[ 8]} {[ 0]} {[ 882.0458]} {[ 0]} {[ 1]} {[ 1]} {[ 0]} {'birth date' } {[04-May-1984 ]} {'cells_dist (m)' } {[ 0]} {[ 10]} {[ 0]} {[ 878.4049]} {[ 0]} {[ 1]} {[ 1]} {[ 0]} {'age (years)' } {[ 38.5500]} {'<Reserved>' } {1×1 missing } {[ 12]} {[ 0]} {[ 875.0555]} {[ 0]} {[ 1]} {[ 1]} {[ 0]} {'extra comment' } {'Marcha normal - marcha inclinado'} {'PGA_V(z)' } {[ 8]} {[ 14]} {[ 0]} {[ 872.1480]} {[ 0]} {[ 1]} {[ 1]} {[ 0]} {'Plate weight (kg)'} {[ 78.9900]} {'PGA_H(y)' } {[ 16]} {[ 16]} {[ 0]} {[ 869.8227]} {[ 0]} {[ 1]} {[ 1]} {[ 0]} {1×1 missing } {1×1 missing } {'PGA_L(x)' } {[ 16]} {[ 18]} {[ 0]} {[ 868.1986]} {[ 0]} {[ 1]} {[ 1]} {[ 0]} {1×1 missing } {1×1 missing } {'referential orientation'} {[ -1]} {[ 20]} {[ 0]} {[ 867.3644]} {[ 0]} {[ 1]} {[ 1]} {[ 0]} {1×1 missing } {1×1 missing } {'Direction' } {[ 1]} {[ 22]} {[ 0]} {[ 867.3719]} {[ 0]} {[ 1]} {[ 1]} {[ 0]} {1×1 missing } {1×1 missing } {'Slope (deg)' } {[ 0]} {[ 24]} {[ 0]} {[ 868.2339]} {[ 0]} {[ 1]} {[ 1]} {[ 0]} {1×1 missing } {1×1 missing } {'Forces Filtering' } {'no' } {[ 26]} {[ 0]} {[ 869.9253]} {[ 0]} {[ 1]} {[ 1]} {[ 0]} {1×1 missing } {1×1 missing } {'Filter_Z_cutoff (Hz)' } {1×1 missing } {[ 28]} {[ 0]} {[ 872.3884]} {[ 0]} {[ 1]} {[ 1]} {[ 0]}
T2 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1250772/AC_nor_4km_Plot_and_Store_Rep_1.0.xlsx','VariableNamingRule','preserve')
T2 = 20201×10 table
X[s] R TIBIALIS ANTERIOR: EMG 2 X[s]_1 R VASTUS MEDIALIS: EMG 7 X[s]_2 R GASTROCNEMIUS LATERAL HEAD: EMG 14 (IM) X[s]_3 R VASTUS LATERALIS: EMG 15 (IM) X[s]_4 R GASTROCNEMIUS MEDIAL HEAD: EMG 16 (IM) __________ __________________________ __________ ________________________ ______ _________________________________________ ______ _______________________________ ______ ________________________________________ 0 0 0 0 0 0 0 0 0 0 0.00051923 0 0.00051923 0 0.0009 0 0.0009 0 0.0009 0 0.0010385 0 0.0010385 0 0.0018 0 0.0018 0 0.0018 0 0.0015577 0 0.0015577 0 0.0027 0 0.0027 0 0.0027 0 0.0020769 0 0.0020769 0 0.0036 0 0.0036 0 0.0036 0 0.0025962 0 0.0025962 0 0.0045 0 0.0045 0 0.0045 0 0.0031154 0 0.0031154 0 0.0054 0 0.0054 0 0.0054 0 0.0036346 0 0.0036346 0 0.0063 0 0.0063 0 0.0063 0 0.0041538 0 0.0041538 0 0.0072 0 0.0072 0 0.0072 0 0.0046731 0 0.0046731 0 0.0081 0 0.0081 0 0.0081 0 0.0051923 0 0.0051923 0 0.009 0 0.009 0 0.009 0 0.0057115 0 0.0057115 0 0.0099 0 0.0099 0 0.0099 0 0.0062308 0 0.0062308 0 0.0108 0 0.0108 0 0.0108 0 0.00675 0 0.00675 0 0.0117 0 0.0117 0 0.0117 0 0.0072692 0 0.0072692 0 0.0126 0 0.0126 0 0.0126 0 0.0077885 0 0.0077885 0 0.0135 0 0.0135 0 0.0135 0
.
Mario
Mario le 4 Jan 2023
Hi @star strader, sorry I didn’t explain very well. I need to cut the data in each stride (from left heel strike to the same heel strike) and established between 0% and 100% of a stride cycle. Then, the idea is to cut the EMG data relative to the stride cycle of the GRF. Thanks so much! Sorry my explanation 🤦🏽

Connectez-vous pour commenter.

Réponses (2)

William Rose
William Rose le 3 Jan 2023
Modifié(e) : William Rose le 3 Jan 2023
[Edit: change sampling frequency from 5000 to 500]
You already have the binary vectors for left contact, right contact, single leg, and double leg support in columns 7-10 of the data array obtained by xlsread('AC.xlsx').
As @Star Strider noted, it is not clear what you want to do with the EMGs. You have multiple strides. Perhaps you want to signal average over the strides. Since stride duration varies, you use some arbitrary marker, such as right foot contact, to mark the start of each stride. Then you rescale each stride so that every stride has the same normalized duration (for example, normalized duraiton=100). You find the average of each EMG channel using the rescaled time for each stride. That deserves to be its own separate question and discussion.
data=xlsread('AC.xlsx');
contact=data(:,7:10); %left,right,single,double
N=length(contact);
fsg=500; %sampling frequency for GRF (Hz)
tg=(0:N-1)/fsg; %time vector for GRF data
subplot(211);
plot(tg,contact(:,1),'-r',tg,contact(:,2),'-g','linewidth',2)
legend('L','R'); xlabel('Time (s)'); ylabel('Contact'); grid on
subplot(212);
plot(tg,contact(:,3),'-b',tg,contact(:,4),'-m','linewidth',2)
legend('Single','Double'); xlabel('Time (s)'); ylabel('Contact'); grid on
Good luck with your research.
  2 commentaires
William Rose
William Rose le 3 Jan 2023
Perhaps you want to extract the EMG during double support only. Here is a way. It starts by getting the doubeele support data, as shown in the previous code. Then you interpolate the double support data to the faster sampling rate which is used for the EMGs. Then you multily the EMG by 0 or 1 where there is not, or is, double support.
I think there is something wrong with file AC_nor_4km_Plot_and_Store_Rep_1.0.xls. It has 10 columns, 1 header row, and 20201 rows of numbers. Columns 1,3,5,7,9 appear to be time, and columns 2,4,6,8,10 appear to be the EMG amplitudes. But the time columns are not sampled at 2 kHz, as you stated. The times in columns 1 and 3 corresond to a sampling rate of approximately 1926 Hz. The times in columns 5,7,9 correspond to a sampling rate of approximately 1111 Hz. An additional problem is that the last 202 rows are zeros.
Mario
Mario le 4 Jan 2023
Thanks so much for your answer. My main idea is to analyze the EMG and GRF of the stride cycle and specifically the double support. I understand the Hz problem, is there a way to relative all the data to the same Hz? Is probably an EMG problem? Thanks have a nice day!

Connectez-vous pour commenter.


William Rose
William Rose le 4 Jan 2023
You said in your original post that the EMG data was sampled at 2 kHz. You said in your comment: "I understand the Hz problem, is there a way to relative all the data to the same Hz?"
You have not answered the question of what the actual sampling rate was for the data in the EMG file. Only you can answer that question, and you must, in order to proceed. Was the rate 2 kHz, for all five channels, or was the rate 1926 Hz for 2 channels and 1111 Hz for three other channels? If it was all sampled at 2 kHz, then why do the time columns say otherwise?
You say in your comment: "My main idea is to analyze the EMG and GRF of the stride cycle and specifically the double support." This is not a sufficient answer for writing code. You need to be much more specific, because "analyze the EMG and GRF of the stride cycle and specifically the double support" could mean any number of things. Consult the large body of existing literature, or a textbook on gait analysis, and decide exactly what you want to do. Maybe you will find one or two specific figures that you want to reproduce using your data. If so, then post those figures, and the sources for them. Consult your advisor.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by