|
29 | 29 | par.windowtime = .2; % time window (s) over which to calculate 2-means clustering (choose value so that max. 1 saccade can occur) |
30 | 30 | par.steptime = .02; % time window shift (s) for each iteration. Use zero for sample by sample processing |
31 | 31 | par.downsamples = [2 5 10]; % downsample levels (can be empty) |
| 32 | +par.downsampFilter = 1; % use chebychev filter when downsampling? 1: yes, 0: no. requires signal processing toolbox. is what matlab's downsampling functions do, but could cause trouble (ringing) with the hard edges in eye-movement data |
32 | 33 | par.chebyOrder = 8; % order of cheby1 Chebyshev downsampling filter, default is normally ok, as long as there are 25 or more samples in the window (you may have less if your data is of low sampling rate or your window is small |
33 | 34 | par.maxerrors = 100; % maximum number of errors allowed in k-means clustering procedure before proceeding to next file |
34 | 35 | % FIXATION DETERMINATION |
|
54 | 55 | checkNumeric(value,key); |
55 | 56 | checkScalar(value,key); |
56 | 57 | par.(key) = value; |
57 | | - case {'chebyOrder','maxerrors','edgeSampInterp'} |
| 58 | + case {'downsampFilter','chebyOrder','maxerrors','edgeSampInterp'} |
58 | 59 | checkInt(value,key); |
59 | 60 | checkScalar(value,key); |
60 | 61 | par.(key) = value; |
|
158 | 159 |
|
159 | 160 | % get kmeans-clustering for averaged signal |
160 | 161 | fprintf('2-Means clustering started for averaged signal \n'); |
161 | | - [data.finalweights,stopped] = twoClusterWeighting(xpos,ypos,missingn,par.downsamples,par.chebyOrder,par.windowtime,par.steptime,par.freq,par.maxerrors); |
| 162 | + [data.finalweights,stopped] = twoClusterWeighting(xpos,ypos,missingn,par.downsamples,par.downsampFilter,par.chebyOrder,par.windowtime,par.steptime,par.freq,par.maxerrors); |
162 | 163 |
|
163 | 164 | % check whether clustering succeeded |
164 | 165 | if stopped |
|
170 | 171 | elseif q2Eyes |
171 | 172 | % get kmeans-clustering for left eye signal |
172 | 173 | fprintf('2-Means clustering started for left eye signal \n'); |
173 | | - [finalweights_left,stopped] = twoClusterWeighting(llx,lly,llmiss,par.downsamples,par.chebyOrder,par.windowtime,par.steptime,par.freq,par.maxerrors); |
| 174 | + [finalweights_left,stopped] = twoClusterWeighting(llx,lly,llmiss,par.downsamples,par.downsampFilter,par.chebyOrder,par.windowtime,par.steptime,par.freq,par.maxerrors); |
174 | 175 |
|
175 | 176 | % check whether clustering succeeded |
176 | 177 | if stopped |
|
180 | 181 |
|
181 | 182 | % get kmeans-clustering for right eye signal |
182 | 183 | fprintf('2-Means clustering started for right eye signal \n'); |
183 | | - [finalweights_right,stopped] = twoClusterWeighting(rrx,rry,rrmiss,par.downsamples,par.chebyOrder,par.windowtime,par.steptime,par.freq,par.maxerrors); |
| 184 | + [finalweights_right,stopped] = twoClusterWeighting(rrx,rry,rrmiss,par.downsamples,par.downsampFilter,par.chebyOrder,par.windowtime,par.steptime,par.freq,par.maxerrors); |
184 | 185 |
|
185 | 186 | % check whether clustering succeeded |
186 | 187 | if stopped |
|
0 commit comments