Hi all,
I have a question regarding the EMG data I am working on. I have attached a file containing a sample data Excel sheet. What I need to do is compute the average of several "windows" for each data set, while also accounting for overlapped sections.For example, Window Size 1 = 1500 points & Overlap Size 1=750 points I then need the mean of each window as follows: [From 1 to 1500] then [750-2250] then [1500 – 3000] etc.
What is the best way to do this? I'm thinking some kind of for loop, but I don't know how exactly to account for overlap. Thank you so much in advance!
Below is the code I have right now to accomplish this. I need a more efficient way to implement this logic into my data set so that I can repeat it easily for various window sizes and overlaps
.clc;clear;[d]=xlsread('Flex1.xls', 'Flex1', 'D5:D10000');[t]=xlsread('Flex1.xls', 'Flex1', 'A5:A10000');mean_d_1_1 = mean(d(1:1500))mean_d_1_2 = mean(d(750:2250))mean_d_1_3 = mean(d(1500:3000))mean_d_1_4 = mean(d(2250:3750))mean_d_1_5 = mean(d(3000:4500))mean_d_1_6 = mean(d(3750:5250))mean_d_1_7 = mean(d(4500:6000))mean_d_1_8 = mean(d(5250:6750))mean_d_1_9 = mean(d(6000:7500))mean_d_1_10 = mean(d(6750:8250))mean_d_1_11 = mean(d(7500:8694)) % code
end
Best Answer