Hello, I have an ECG data of 20mins length (2×307200). I want to apply a 20 sec window(5120) with an overlap of 64samples. I want 20 sec segments so i can extract features from it. I tried to write a loop for window but it doesn't give me right answer. Can somebody help me.
ECG_data=[time; ECG]; N_max=length(ECG_data); n_window=5120; overlap_win=64; count=1; for n_start = 1:overlap_win:(N_max-n_window) New_data(count,:) = ECG_data(n_start_1:(n_start+ n_window)); do something.. mean(count,:)=mean(new_data); count=count+1; end
The number of samples in each window is limited to 4720 sample(thats 18 sec) even though i need 20sec(5120). What am I doing wrong here? it something to do with the termination of window?? Also how can i retain the time information after applying window?
Best Answer