This is the code I am running.
sf = 399.0698; %sampling frequency (Hz), samples per second
T = 1/sf;
timeSeries = T:T:600.8122;
%y filtered data
d = designfilt('lowpassfir', ...
y = filtfilt(d,interictal_segment_1.data(1,:));
%findpeak for y signal in row 1
[pks,locs] = findpeaks(y(1,:),'MinPeakDistance',0.3);
I have found the local max for my signal y(1,:). However i would like to find fluctuations in the signal for successive 1 second, non-overlapping windows. Supposed that peaks 1,2,3,4 are successive local max.
fluctuations are counted for a total length of 1 second and data is kept in window.1. Repeat for another 1s and keep data in window.2.
I am new to Matlab so any help is appreciated. Thank you.