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

vPrime/sound

parent 503c4d54
...@@ -7,28 +7,46 @@ function handles = pb_getblock(handles) ...@@ -7,28 +7,46 @@ function handles = pb_getblock(handles)
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl % PBToolbox (2018): JJH: j.heckman@donders.ru.nl
%% INITIALIZE
% Get handles and read experiment.
cfg = handles.cfg; cfg = handles.cfg;
[block, cfg] = pb_vReadExp(cfg); [block, cfg] = pb_vReadExp(cfg);
%% CFG file %% 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.
cfg.cfgfname = which('HumanNH.cfg'); cfg.cfgfname = which('HumanNH.cfg');
cfg = pb_vReadCFG(cfg); % read cfg cfile 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.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.nsamples = round(cfg.acqdur/1000*cfg.RZ6Fs); % length data acquisition (samples)
cfg.nchan = 3; cfg.nchan = 3;
%% Correct Block %% CHECK-OUT
block = pb_vPrimeZ(block,cfg); % Define trial duration, correct stimulus positions, and store handles.
%% Timing
cfg.trialdur = getdurations(block); % sets trialdur
handles.block = block; cfg.trialdur = getdurations(block);
handles.block = pb_vPrimeZ(block,cfg);
handles.cfg = cfg; handles.cfg = cfg;
end end
function td = getdurations(block) function td = getdurations(block)
% extracts trial and block dur % Extracts trial and block dur
stimarr = []; stimarr = [];
blocksz = length(block); blocksz = length(block);
......
...@@ -24,7 +24,6 @@ function block = pb_vPrimeZ(block,cfg) ...@@ -24,7 +24,6 @@ function block = pb_vPrimeZ(block,cfg)
block(iBlck).trial(iTrl).stim(iStm).Z = ZI; 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).azimuth = cfg.lookup(ZI+1,4);
block(iBlck).trial(iTrl).stim(iStm).elevation = cfg.lookup(ZI+1,5); block(iBlck).trial(iTrl).stim(iStm).elevation = cfg.lookup(ZI+1,5);
end end
end end
end end
......
...@@ -49,5 +49,3 @@ end ...@@ -49,5 +49,3 @@ end
% Written by: Jesse J. Heckman (2018) % % Written by: Jesse J. Heckman (2018) %
% % % %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
a
\ No newline at end of file
...@@ -8,7 +8,7 @@ function [stim, cfg] = pb_vSetupTrial(stim,cfg) ...@@ -8,7 +8,7 @@ function [stim, cfg] = pb_vSetupTrial(stim,cfg)
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl % PBToolbox (2018): JJH: j.heckman@donders.ru.nl
%% Set TDT parameters %% SET TDT PARAMETERS
selled = strcmpi({stim.modality},'LED'); selled = strcmpi({stim.modality},'LED');
selsnd = strcmpi({stim.modality},'sound'); selsnd = strcmpi({stim.modality},'sound');
...@@ -57,7 +57,7 @@ function [stim, cfg] = pb_vSetupTrial(stim,cfg) ...@@ -57,7 +57,7 @@ function [stim, cfg] = pb_vSetupTrial(stim,cfg)
stim(find(selled,1)).ledhandle.write(s); stim(find(selled,1)).ledhandle.write(s);
end end
%% Sound %% SOUND
if any(selsnd) if any(selsnd)
snd = stim(selsnd); snd = stim(selsnd);
...@@ -78,7 +78,7 @@ function [stim, cfg] = pb_vSetupTrial(stim,cfg) ...@@ -78,7 +78,7 @@ function [stim, cfg] = pb_vSetupTrial(stim,cfg)
end end
cfg.maxSamples = maxSamples; cfg.maxSamples = maxSamples;
%% Wait %% WAIT
ev = stim.offevent; ev = stim.offevent;
de = stim.offdelay; 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