Commit 3447f87d authored by Jesse Heckman's avatar Jesse Heckman
Browse files

implementation of VOR signal in vPrime

parent 66ad3548
...@@ -24,6 +24,8 @@ function D = pb_vCreateSignal(N, dur, SR, freq, type, varargin) ...@@ -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); [D(i).x,D(i).t] = VC_predictedsine(dur, SR, freq);
case 'turn' case 'turn'
[D(i).x,D(i).t] = VC_turnsignal(dur, SR); [D(i).x,D(i).t] = VC_turnsignal(dur, SR);
case 'vor'
[D(i).x,D(i).t] = VC_VOR(dur, SR);
otherwise otherwise
error('False type specification'); error('False type specification');
end end
...@@ -82,13 +84,17 @@ function [x,t] = VC_turnsignal(dur, SR) ...@@ -82,13 +84,17 @@ function [x,t] = VC_turnsignal(dur, SR)
t = 0:1/SR:dur; t = 0:1/SR:dur;
x = t; x = t;
end
% dx = diff(x); function [x,t] = VC_VOR(dur, SR)
% % function will create turn signal of length dur
% dxsz = length(ds);
% t = 0:1/SR:dur;
% tsz = length(t); x = t;
% x = t .* tukeywin(tsz,0.25)';
tsz = length(t);
ind = floor(tsz/2);
x(ind+1:end) = x(ind);
end end
......
...@@ -223,7 +223,7 @@ end ...@@ -223,7 +223,7 @@ end
function signal = readVest(line) function signal = readVest(line)
% reads VS signal from the expfile % 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))); n = str2num(erase(sscanf(line,'%s',2),sscanf(line,'%s',1)));
type = types{n}; type = types{n};
signal.type = type; signal.type = type;
......
...@@ -111,9 +111,16 @@ function pb_vGenVisExp(varargin) ...@@ -111,9 +111,16 @@ function pb_vGenVisExp(varargin)
nblockreps = N/trialsinblock; nblockreps = N/trialsinblock;
block(1).Horizontal = struct('Amplitude', 0, 'Signal', 1, 'Duration', BD, 'Frequency',.1); 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).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 %% Save data somewhere
writeexp(expfile,datdir,X,Y,int,dur,block,fixled); writeexp(expfile,datdir,X,Y,int,dur,block,fixled);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment