neurofractal / analyse_OPMEG

Nic & Rob's lair of scripts to analyse OPM data, using the Fieldtrip toolbox
https://neurofractal.github.io/analyse_OPMEG/
MIT License
9 stars 1 forks source link

Sliding Windows for Synthetic Gradiomety #25

Closed neurofractal closed 4 years ago

neurofractal commented 4 years ago

Like #24, but for synthetic gradiometry.

Might require quite a bit re-write

neurofractal commented 4 years ago

Using the code from nt_detrend. The only outstanding question is this bit of the code.. which seems to grow the size of the window 5 times?

Window then slides by winsize/2.

So I currently I think the code is implemented such that, when winsize = 10s:

data_in_window = 60s stepsize = 5s

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % These values are grown by a factor of 5
 % Is this needed??
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

counter=5;
while any (sum(min(w(start:stop),1))) <wsize
        if counter <= 0 ; break; end
        start=max(1,start-wsize/2);
        stop=min(size(x,2),stop+wsize/2);
        counter=counter-1;
end
neurofractal commented 4 years ago

Now implemented: see function HERE