Commit 8b26590c authored by Jesse Heckman's avatar Jesse Heckman

vPrime/sound

parent 503c4d54
......@@ -7,28 +7,46 @@ function handles = pb_getblock(handles)
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
%% INITIALIZE
% Get handles and read experiment.
cfg = handles.cfg;
[block, cfg] = pb_vReadExp(cfg);
%% CFG file
cfg.cfgfname = which('HumanNH.cfg');
cfg = pb_vReadCFG(cfg); % read cfg cfile
cfg.acqdur = cfg.humanv1.ADC(1).samples / cfg.humanv1.ADC(1).rate * 1000; % TODO: HumanV1/duration of data acquisition (ms)
cfg.nsamples = round(cfg.acqdur/1000*cfg.RZ6Fs); % length data acquisition (samples)
cfg.nchan = 3;
%% FILTER PARAMETERS
% Will select the appriopriate filter setting for GWN sounds, default is expname else
% soundParameters.mat is loaded.
fn = fullfile(cfg.expdir,cfg.expfname);
fn = fcheckext(fn,'mat');
par = 'parameters';
if exist(fn,'file')
load(fn,par);
else
load(which('soundParameters.mat'),par)
end
cfg.parameters = parameters;
%% CFG FILE
% Will extract the correct cfg settings. Current default is set to
% HumanNH.cfg.
%% Correct Block
block = pb_vPrimeZ(block,cfg);
cfg.cfgfname = which('HumanNH.cfg');
cfg = pb_vReadCFG(cfg); % read cfg cfile
cfg.acqdur = cfg.humanv1.ADC(1).samples / cfg.humanv1.ADC(1).rate * 1000; % TODO: HumanV1/duration of data acquisition (ms)
cfg.nsamples = round(cfg.acqdur/1000*cfg.RZ6Fs); % length data acquisition (samples)
cfg.nchan = 3;
%% Timing
cfg.trialdur = getdurations(block); % sets trialdur
%% CHECK-OUT
% Define trial duration, correct stimulus positions, and store handles.
handles.block = block;
handles.cfg = cfg;
cfg.trialdur = getdurations(block);
handles.block = pb_vPrimeZ(block,cfg);
handles.cfg = cfg;
end
function td = getdurations(block)
% extracts trial and block dur
% Extracts trial and block dur
stimarr = [];
blocksz = length(block);
......
......@@ -24,7 +24,6 @@ function block = pb_vPrimeZ(block,cfg)
block(iBlck).trial(iTrl).stim(iStm).Z = ZI;
block(iBlck).trial(iTrl).stim(iStm).azimuth = cfg.lookup(ZI+1,4);
block(iBlck).trial(iTrl).stim(iStm).elevation = cfg.lookup(ZI+1,5);
end
end
end
......
......@@ -49,5 +49,3 @@ end
% Written by: Jesse J. Heckman (2018) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
a
\ No newline at end of file
......@@ -8,7 +8,7 @@ function [stim, cfg] = pb_vSetupTrial(stim,cfg)
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
%% Set TDT parameters
%% SET TDT PARAMETERS
selled = strcmpi({stim.modality},'LED');
selsnd = strcmpi({stim.modality},'sound');
......@@ -57,7 +57,7 @@ function [stim, cfg] = pb_vSetupTrial(stim,cfg)
stim(find(selled,1)).ledhandle.write(s);
end
%% Sound
%% SOUND
if any(selsnd)
snd = stim(selsnd);
......@@ -78,7 +78,7 @@ function [stim, cfg] = pb_vSetupTrial(stim,cfg)
end
cfg.maxSamples = maxSamples;
%% Wait
%% WAIT
ev = stim.offevent;
de = stim.offdelay;
......
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