Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Jesse Heckman
pbtoolbox
Commits
a8e4d8ee
Commit
a8e4d8ee
authored
May 22, 2019
by
Jesse Heckman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update write exp
parent
adf462fc
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
251 additions
and
12 deletions
+251
-12
StateMachineV1.8.rcx
StateMachineV1.8.rcx
+0
-0
setups/vestibular chair/vPrime/expfile/experiments/default_vc.exp
...estibular chair/vPrime/expfile/experiments/default_vc.exp
+18
-0
setups/vestibular chair/vPrime/expfile/experiments/pb_vGenExp_Vis.m
...tibular chair/vPrime/expfile/experiments/pb_vGenExp_Vis.m
+1
-0
setups/vestibular chair/vPrime/expfile/experiments/pb_vVestExp.m
...vestibular chair/vPrime/expfile/experiments/pb_vVestExp.m
+2
-2
setups/vestibular chair/vPrime/expfile/experiments/pb_vWriteSnd.m
...estibular chair/vPrime/expfile/experiments/pb_vWriteSnd.m
+35
-0
setups/vestibular chair/vPrime/expfile/pb_vGenExp_defAud.m
setups/vestibular chair/vPrime/expfile/pb_vGenExp_defAud.m
+184
-0
setups/vestibular chair/vPrime/lookup/lookup_VC.xlsx
setups/vestibular chair/vPrime/lookup/lookup_VC.xlsx
+0
-0
setups/vestibular chair/vPrime/lookup/vPrime Measurement.xlsx
...ps/vestibular chair/vPrime/lookup/vPrime Measurement.xlsx
+0
-0
utilities/graphics/desgin/pb_defsubplot.m
utilities/graphics/desgin/pb_defsubplot.m
+9
-8
utilities/housekeeping/pb_newfig.m
utilities/housekeeping/pb_newfig.m
+2
-2
No files found.
StateMachineV1.8.rcx
deleted
100644 → 0
View file @
adf462fc
File deleted
setups/vestibular chair/vPrime/expfile/experiments/default_vc.exp
0 → 100644
View file @
a8e4d8ee
%
%% Experiment: C:\DATA\DEFAULT
%
ITI 0 0
Trials 19
Repeats 1
Random 0 % 0=no, 1=per set, 2=all trials
Motor n
Lab 2
% MOD X Y ID INT On On Off Off Event
% edg bit Event Time Event Time
%AX SIG AMP DUR FREQ
% edg bit Event Time Event Time
% Trial: 1
==>
setups/vestibular chair/vPrime/expfile/experiments/pb_vGenExp_Vis.m
View file @
a8e4d8ee
...
...
@@ -59,6 +59,7 @@ function pb_vGenExp_Vis(varargin)
dEl
=
dEl
(
sel
);
nloc
=
numel
(
dAz
);
%% Select target positions
% Get targerts.
...
...
setups/vestibular chair/vPrime/expfile/experiments/pb_vVestExp.m
View file @
a8e4d8ee
...
...
@@ -43,8 +43,8 @@ function pb_vVestExp(varargin)
BD
=
60
;
% block duration in seconds
%% Sine
block
(
1
)
.
Horizontal
=
struct
(
'Amplitude'
,
0
,
'Signal'
,
2
,
'Duration'
,
BD
,
'Frequency'
,
.
3
);
block
(
1
)
.
Vertical
=
struct
(
'Amplitude'
,
13
,
'Signal'
,
2
,
'Duration'
,
BD
,
'Frequency'
,
.
3
);
block
(
1
)
.
Horizontal
=
struct
(
'Amplitude'
,
0
,
'Signal'
,
1
,
'Duration'
,
0
,
'Frequency'
,
.
1
);
block
(
1
)
.
Vertical
=
struct
(
'Amplitude'
,
0
,
'Signal'
,
1
,
'Duration'
,
0
,
'Frequency'
,
.
1
);
block
(
2
)
.
Horizontal
=
struct
(
'Amplitude'
,
0
,
'Signal'
,
2
,
'Duration'
,
BD
,
'Frequency'
,
.
2
);
block
(
2
)
.
Vertical
=
struct
(
'Amplitude'
,
20
,
'Signal'
,
2
,
'Duration'
,
BD
,
'Frequency'
,
.
2
);
...
...
setups/vestibular chair/vPrime/expfile/experiments/pb_vWriteSnd.m
0 → 100644
View file @
a8e4d8ee
function
pb_vWriteSnd
(
fid
,
SND
,
X
,
Y
,
ID
,
Int
,
EventOn
,
Onset
,
Offset
)
% PB_VWRITESND()
%
% PB_VWRITESND() ...
%
% See also ...
% PBToolbox (2019): JJH: j.heckman@donders.ru.nl
% WRITESND(FID,SND,X,Y,ID,INT,EVENTON,ONSET,EVENTOFF,OFFSET)
%
% Write a SND-stimulus line in an exp-file with file identifier FID.
%
% SND - 'SND1' or 'SND2'
% X - SND theta angle
% Y - SND phi number (1-29 and 101-129)
% INT - SND Intensity (0-100)
% EVENTON - The Event that triggers the onset of the SND (0 - start of
% trial)
% ONSET - The Time after the On Event (msec)
% EVENTOFF - The event that triggers the offset of the SND
% OFFSET - The time after the off event (mse)
fprintf
(
fid
,
'%s\t%d\t%d\t \t%d\t%d\t%d\t%d\t%d\n'
,
SND
,
X
,
Y
,
ID
,
Int
,
EventOn
,
Onset
,
Offset
);
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2019) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
setups/vestibular chair/vPrime/expfile/pb_vGenExp_defAud.m
0 → 100644
View file @
a8e4d8ee
function
pb_vGenexp_defAud
% PB_VGENEXP_DEFAUD()
%
% PB_VGENEXP_DEFAUD() ...
%
% See also ...
% PBToolbox (2019): JJH: j.heckman@donders.ru.nl
%%
close
all
;
clear
hidden
;
disp
(
'>> GENERATING EXPERIMENT <<'
);
expfile
=
'defAud.exp'
;
% file name
datdir
=
'DEFAULT'
;
showexp
=
true
;
%%
% Select target ranges
maxAbsAz
=
55
;
maxAbsEl
=
35
;
% Possible targets
dAz
=
-
50
:
05
:
50
;
dEl
=
-
30
:
10
:
30
;
[
dAz
,
dEl
]
=
meshgrid
(
dAz
,
dEl
);
dAz
=
dAz
(:);
dEl
=
dEl
(:);
sel1
=
(
abs
(
dAz
)
+
abs
(
dEl
))
<=
maxAbsAz
&
abs
(
dEl
)
<=
maxAbsEl
;
sel2
=
rem
(
abs
(
dAz
),
2
)
==
0
|
dEl
==
0
;
sel
=
sel1
&
sel2
;
dAz
=
dAz
(
sel
);
dEl
=
dEl
(
sel
);
nloc
=
numel
(
dAz
);
%% led
%fixled
fixled
.
bool
=
true
;
% do you want a fixation light?
fixled
.
x
=
0
;
fixled
.
y
=
0
;
fixled
.
dur
=
1000
;
fixled
.
pause
=
1000
;
%length sound
maxsnd
=
200
;
minsnd
=
200
;
dur
=
[
250
];
dur
=
dur
(:)
;
%% Actual azimuth and elevation
% The actual speaker positions are not perfectly aligned with 5 deg
cfg
=
pb_vLookup
;
% sphere positions
channel
=
cfg
.
interpolant
(
dAz
',dEl'
);
%%
X
=
cfg
.
lookup
(
channel
+
1
,
4
);
Y
=
cfg
.
lookup
(
channel
+
1
,
5
);
%% plot graphics
figure
;
hold
on
;
plot
(
dAz
,
dEl
,
'.'
)
hold
on
plot
(
X
,
Y
,
'.'
)
axis
([
-
60
60
-
60
60
]);
axis
square
set
(
gca
,
'TickDir'
,
'out'
);
xlabel
(
'Azimuth (deg)'
);
ylabel
(
'Elevation (deg)'
);
grid
on
;
%% intensity and frequency
int
=
[
65
];
% these DB intensities?
snd
=
[
1
];
% Only Broadband or more?
[
X
,
~
,
~
]
=
ndgrid
(
X
,
int
,
snd
);
[
Y
,
int
,
snd
]
=
ndgrid
(
Y
,
int
,
snd
);
X
=
X
(:);
Y
=
Y
(:);
int
=
int
(:);
snd
=
snd
(:);
%% trails
Sz
=
size
(
X
);
N
=
Sz
(
1
);
%trails
%%
sndon
=
1250
;
sndon
=
repmat
(
sndon
,
N
,
1
);
sndon
=
sndon
(:);
ledon
=
1000
;
ledon
=
repmat
(
ledon
,
N
,
1
);
ledon
=
ledon
(:);
%% Randomize
rnd
=
randperm
(
N
);
X
=
round
(
X
(
rnd
));
Y
=
round
(
Y
(
rnd
));
%% vestiular block
block
(
1
)
.
Horizontal
=
struct
(
'Signal'
,
1
,
'Amplitude'
,
0
,
'Duration'
,
0
,
'Frequency'
,
.
1
);
block
(
1
)
.
Vertical
=
struct
(
'Signal'
,
1
,
'Amplitude'
,
0
,
'Duration'
,
0
,
'Frequency'
,
.
1
);
%% Save data somewhere
writeexp
(
expfile
,
datdir
,
X
,
Y
,
snd
,
int
,
ledon
,
sndon
,
dur
,
block
)
%,fixled);
% see below, these are helper functions to write an exp-file line by line / stimulus by stimulus
%% Show the exp-file in Wordpad
% for PCs
if
showexp
if
ispc
dos
([
'"C:\Program Files\Windows NT\Accessories\wordpad.exe" '
expfile
' &'
]);
elseif
ismac
system
([
'open -a TextWrangler '
cd
filesep
expfile
]);
end
end
end
function
writeexp
(
expfile
,
datdir
,
X
,
Y
,
snd
,
int
,
ledon
,
sndon
,
dur
,
block
)
% Save known trial-configurations in exp-file
%
%WRITEEXP WRITEEXP(FNAME,DATDIR,THETA,PHI,ID,INT,LEDON,SNDON)
%
% WRITEEXP(FNAME,THETA,PHI,ID,INT,LEDON,SNDON)
%
% Write exp-file with file-name FNAME.
%
%
% See also manual at neural-code.com
expfile
=
fcheckext
(
expfile
,
'.exp'
);
% check whether the extension exp is included
fid
=
fopen
(
expfile
,
'wt+'
);
% this is the way to write date to a new file
ntrials
=
numel
(
X
);
blocksz
=
length
(
block
);
%% Header of exp-file
ITI
=
[
0
0
];
% useless, but required in header
Rep
=
1
;
% we have 0 repetitions, so insert 1...
Rnd
=
0
;
% we randomized ourselves already
Mtr
=
'n'
;
% the motor should be on
writeheader
(
fid
,
datdir
,
ITI
,
ntrials
*
Rep
,
Rep
,
Rnd
,
Mtr
,
'Lab'
,
2
);
% helper-function
%% Body of exp-file
% Create a trial
for
iBlock
=
1
:
blocksz
% Write blocks
pb_vWriteBlock
(
fid
,
iBlock
);
pb_vWriteSignal
(
fid
,
block
(
iBlock
));
for
ii
=
1
:
ntrials
% each location
writetrl
(
fid
,
ii
);
writeled
(
fid
,
'LED'
,
0
,
0
,
5
,
0
,
0
,
0
,
ledon
(
ii
));
% fixation LED
pb_writesnd
(
fid
,
'SND'
,
round
(
X
(
ii
)),
Y
(
ii
),
snd
(
ii
),
0
,
0
,
ledon
(
ii
)
+
sndon
(
ii
),
ledon
(
ii
)
+
sndon
(
ii
)
+
dur
);
% Sound on
end
end
fclose
(
fid
);
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2019) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
setups/vestibular chair/vPrime/lookup/lookup_VC.xlsx
deleted
100644 → 0
View file @
adf462fc
File deleted
setups/vestibular chair/vPrime/lookup/vPrime Measurement.xlsx
View file @
a8e4d8ee
No preview for this file type
utilities/graphics/desgin/pb_defsubplot.m
View file @
a8e4d8ee
...
...
@@ -11,19 +11,20 @@ function [n,p] = pb_defsubplot(fig)
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
figure
(
fig
);
h
=
flipud
(
find
obj
(
gcf
,
'Type'
,
'Axes'
)
)
;
h
=
pb_f
obj
(
gcf
,
'Type'
,
'Axes'
);
n
=
length
(
h
);
p
=
zeros
(
1
,
n
);
for
i
=
1
:
n
p
(
i
)
=
length
(
findobj
(
h
(
i
),
'Type'
,
'Line'
))
+
...
length
(
findobj
(
h
(
i
),
'Type'
,
'FunctionLine'
))
+
...
length
(
findobj
(
h
(
i
),
'Type'
,
'Bar'
))
+
...
length
(
findobj
(
h
(
i
),
'Type'
,
'Area'
))
+
...
length
(
findobj
(
h
(
i
),
'Type'
,
'ErrorBar'
))
+
...
length
(
findobj
(
h
(
i
),
'Type'
,
'Stem'
))
+
...
length
(
findobj
(
h
(
i
),
'Type'
,
'Histogram'
));
p
(
i
)
=
length
(
pb_fobj
(
h
(
i
),
'Type'
,
'Line'
))
+
...
length
(
pb_fobj
(
h
(
i
),
'Type'
,
'FunctionLine'
))
+
...
length
(
pb_fobj
(
h
(
i
),
'Type'
,
'Bar'
))
+
...
length
(
pb_fobj
(
h
(
i
),
'Type'
,
'Area'
))
+
...
length
(
pb_fobj
(
h
(
i
),
'Type'
,
'ErrorBar'
))
+
...
length
(
pb_fobj
(
h
(
i
),
'Type'
,
'Stem'
))
+
...
length
(
pb_fobj
(
h
(
i
),
'Type'
,
'Histogram'
))
+
...
length
(
pb_fobj
(
h
(
i
),
'Type'
,
'Patch'
));
end
end
...
...
utilities/housekeeping/pb_newfig.m
View file @
a8e4d8ee
...
...
@@ -11,7 +11,7 @@ function [cfn,f] = pb_newfig(cfn, varargin)
if
isempty
(
cfn
);
cfn
=
0
;
end
units
=
pb_keyval
(
'units'
,
varargin
,
'centimeters'
);
ws
=
pb_keyval
(
'ws'
,
varargin
,
'normal
'
);
ws
=
pb_keyval
(
'ws'
,
varargin
,
'
docked'
);
%
normal
rsz
=
pb_keyval
(
'resize'
,
varargin
,
'on'
);
sz
=
pb_keyval
(
'size'
,
varargin
,[
0
0
17
11
]);
...
...
@@ -22,7 +22,7 @@ function [cfn,f] = pb_newfig(cfn, varargin)
set
(
f
,
'Units'
,
units
);
set
(
f
,
'Resize'
,
rsz
)
if
~
strcmp
(
ws
,
'
D
ocked'
);
set
(
f
,
'Position'
,
sz
);
end
if
~
strcmp
(
ws
,
'
d
ocked'
);
set
(
f
,
'Position'
,
sz
);
end
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment