Extract data between peaks
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
jay yawson
am 10 Jun. 2019
Kommentiert: Adam Danz
am 11 Jun. 2019
Hello everyone, I would really appreciate help on solving this problem. I am trying to segment an emg data based on heelstrikes recorded from the accelerometer. I have used the peak to peak to find the location of the heelstrikes. The first peak, third and fifth peak belong to the right foot. The second, fourth,and sixth correspond to the left foot. I would like to extract the data between. Two heelstrikes of the same foot. For example I would like to write a for loop to extract the emg data from peak 1 to peak 3, then peak 3 to peak 5 till the last peak. Here's what I tried to do but it doesn't work. I have showed the extraction portion in the picture attached. Thanks in advance
if true
% clear all
EMG = readmatrix('straightLASER01.xlsx','Sheet',1); %read emg data
ACC = readmatrix('straightLASER01.xlsx','Sheet',2); %read accleration data
[pks,locs] = findpeaks(ACC,'MinPeakDistance',1000); %find peaks
for p = 1:length(locs)
first_strike = floor(locs(p,:));
third_strike = floor(locs((p+2),:));
acc = EMG1(first_strike:third_strike , p);
end
end
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spectral Measurements finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!