Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jesse Heckman
pbtoolbox
Commits
3447f87d
Commit
3447f87d
authored
Nov 27, 2018
by
Jesse Heckman
Browse files
implementation of VOR signal in vPrime
parent
66ad3548
Changes
3
Hide whitespace changes
Inline
Side-by-side
setups/vestibular chair/vPrime/core/experiment/block/pb_vCreateSignal.m
View file @
3447f87d
...
...
@@ -24,6 +24,8 @@ function D = pb_vCreateSignal(N, dur, SR, freq, type, varargin)
[
D
(
i
)
.
x
,
D
(
i
)
.
t
]
=
VC_predictedsine
(
dur
,
SR
,
freq
);
case
'turn'
[
D
(
i
)
.
x
,
D
(
i
)
.
t
]
=
VC_turnsignal
(
dur
,
SR
);
case
'vor'
[
D
(
i
)
.
x
,
D
(
i
)
.
t
]
=
VC_VOR
(
dur
,
SR
);
otherwise
error
(
'False type specification'
);
end
...
...
@@ -82,13 +84,17 @@ function [x,t] = VC_turnsignal(dur, SR)
t
=
0
:
1
/
SR
:
dur
;
x
=
t
;
end
function
[
x
,
t
]
=
VC_VOR
(
dur
,
SR
)
% function will create turn signal of length dur
t
=
0
:
1
/
SR
:
dur
;
x
=
t
;
% dx = diff(x);
%
% dxsz = length(ds);
%
% tsz = length(t);
% x = t .* tukeywin(tsz,0.25)';
tsz
=
length
(
t
);
ind
=
floor
(
tsz
/
2
);
x
(
ind
+
1
:
end
)
=
x
(
ind
);
end
...
...
setups/vestibular chair/vPrime/core/experiment/pb_vReadExp.m
View file @
3447f87d
...
...
@@ -223,7 +223,7 @@ end
function
signal
=
readVest
(
line
)
% reads VS signal from the expfile
types
=
{
'none'
,
'sine'
,
'noise'
,
'turn'
};
types
=
{
'none'
,
'sine'
,
'noise'
,
'turn'
,
'vor'
};
n
=
str2num
(
erase
(
sscanf
(
line
,
'%s'
,
2
),
sscanf
(
line
,
'%s'
,
1
)));
type
=
types
{
n
};
signal
.
type
=
type
;
...
...
@@ -231,7 +231,7 @@ function signal = readVest(line)
if
~
strcmp
(
type
,
'none'
)
signal
.
amplitude
=
str2double
(
erase
(
sscanf
(
line
,
'%s'
,
3
),
sscanf
(
line
,
'%s'
,
2
)));
signal
.
duration
=
str2double
(
erase
(
sscanf
(
line
,
'%s'
,
4
),
sscanf
(
line
,
'%s'
,
3
)));
signal
.
frequency
=
str2double
(
erase
(
sscanf
(
line
,
'%s'
,
5
),
sscanf
(
line
,
'%s'
,
4
)));
signal
.
frequency
=
str2double
(
erase
(
sscanf
(
line
,
'%s'
,
5
),
sscanf
(
line
,
'%s'
,
4
)));
else
signal
.
amplitude
=
0
;
signal
.
duration
=
0
;
...
...
setups/vestibular chair/vPrime/experiment/pb_vGenVisExp.m
View file @
3447f87d
...
...
@@ -111,9 +111,16 @@ function pb_vGenVisExp(varargin)
nblockreps
=
N
/
trialsinblock
;
block
(
1
)
.
Horizontal
=
struct
(
'Amplitude'
,
0
,
'Signal'
,
1
,
'Duration'
,
BD
,
'Frequency'
,
.
1
);
block
(
1
)
.
Vertical
=
struct
(
'Amplitude'
,
25
,
'Signal'
,
2
,
'Duration'
,
BD
,
'Frequency'
,
.
1
);
block
(
1
)
.
Vertical
=
struct
(
'Amplitude'
,
0
,
'Signal'
,
1
,
'Duration'
,
BD
,
'Frequency'
,
.
1
);
block
(
2
)
.
Horizontal
=
struct
(
'Amplitude'
,
0
,
'Signal'
,
1
,
'Duration'
,
BD
,
'Frequency'
,
.
1
);
block
(
2
)
.
Vertical
=
struct
(
'Amplitude'
,
0
,
'Signal'
,
2
,
'Duration'
,
BD
,
'Frequency'
,
.
1
);
block
(
2
)
.
Vertical
=
struct
(
'Amplitude'
,
25
,
'Signal'
,
2
,
'Duration'
,
BD
,
'Frequency'
,
.
1
);
block
(
3
)
.
Horizontal
=
struct
(
'Amplitude'
,
0
,
'Signal'
,
1
,
'Duration'
,
BD
,
'Frequency'
,
.
1
);
block
(
3
)
.
Vertical
=
struct
(
'Amplitude'
,
25
,
'Signal'
,
2
,
'Duration'
,
BD
,
'Frequency'
,
.
1
);
block
(
4
)
.
Horizontal
=
struct
(
'Amplitude'
,
0
,
'Signal'
,
1
,
'Duration'
,
BD
,
'Frequency'
,
.
1
);
block
(
4
)
.
Vertical
=
struct
(
'Amplitude'
,
25
,
'Signal'
,
2
,
'Duration'
,
BD
,
'Frequency'
,
.
1
);
%% Save data somewhere
writeexp
(
expfile
,
datdir
,
X
,
Y
,
int
,
dur
,
block
,
fixled
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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