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)
[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
......
......@@ -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;
......
......@@ -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);
......
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