-
Notifications
You must be signed in to change notification settings - Fork 0
/
configReader.m
62 lines (52 loc) · 1.58 KB
/
configReader.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
% Prevent running this file multiple times
if ( exist('readerConfig','var') && ~isempty(readerConfig) )
return;
end;
readerConfig=true;
run ../utilities/initPaths;
buffhost='localhost';
buffport=1972;
global ft_buff;
ft_buff=struct('host',buffhost,'port',buffport);
% Wait for the buffer to return valid header information
hdr=[];
% Wait for the buffer to contain valid data
while ( isempty(hdr) || ~isstruct(hdr) || (hdr.nchans==0) )
try
hdr=buffer('get_hdr',[],buffhost,buffport);
catch
hdr=[];
fprintf('Invalid header info... waiting.\n');
end;
pause(1);
end;
% Set the real-time-clock to use
initgetwTime();
initsleepSec();
% Assign electordes of interest and their topolog
capFile='cap_tmsi_mobita_reader10'; % For a 32-electrodes setup use - cap_tmsi_mobita_reader32;
verb = 1;
buffhost = 'localhost';
buffport = 1972;
nFunction = 5;
nSequence = 40;
nBlock = 2; %number of stim blocks to use
nTestSequence = 20;
trialDuration = 3;
baselineDuration = 1;
intertrialDuration = 2;
feedbackDuration = 1;
moveScale = .1;
stimulus = [' R ';
' L ';
' U ';
' D ';
'keep calm'];
bgColor = [0 0 0]; % Background color
fixColor = [1 0 0]; % Fixation cross color
tgtColor = [1 1 1]; % Target color
fbColor = [0 1 0]; % Feedback color (in Epoch Feedback).
% Neurofeedback smoothing
trlen_ms=3000; % how often to run the classifier
trlen_ms_ol=trlen_ms;
expSmoothFactor = log(2)/log(10); % smooth the last 10...