Commit 0ebb9004 authored by Joanna Luberadzka's avatar Joanna Luberadzka

not needed results removed, added experiment scripts experimentDOA_...

parent f58993cd
% run#
% track1: exppar1;
1
8.00000000
16.00000000
% run#
% track1: exppar1;
1
8.00000000
16.00000000
% run#
% track1: exppar1;
3
8.00000000
16.00000000
% exppar1[Hz] expvar[dB]
8.00000000 -22.83333333 1.34370962
16.00000000 -17.50000000 0.50000000
% example_cfg - example measurement configuration file -
%
% This matlab skript is called by afc_main when starting
% the experiment 'example'.
% example_cfg constructs a structure 'def' containing the complete
% configuration for the experiment.
% To design an own experiment, e.g., 'myexperiment'
% make changes in this file and save it as 'myexperiment_cfg.m'.
% The default values of all parameters are defined in 'default_cfg.m'
%
% See also help example_set, example_user, afc_main
%
% Copyright (c) 1999-2013 Stephan Ewert.
% general measurement procedure
def.measurementProcedure = 'transformedUpDown'; % measurement procedure
def.intervalnum = 3; % number of intervals
def.rule = [1 2]; % [up down]-rule: [1 2] = 1-up 2-down
def.varstep = [4 2 1]; % [starting stepsize ... minimum stepsize] of the tracking variable
def.steprule = -1; % stepsize is changed after each upper (-1) or lower (1) reversal
def.reversalnum = 6; % number of reversals in measurement phase
def.repeatnum = 1; % number of repeatitions of the experiment
% experimental variable (result of procedure yields dependent variable)
def.startvar = 5; % starting value of the tracking variable
def.expvarunit = 'dB'; % unit of the tracking variable
def.expvardescription = 'noise level'; % description of the tracking variable
% limits for experimental variable
def.minvar = 100; % minimum value of the tracking variable
def.maxvar = 0; % maximum value of the tracking variable
def.terminate = 1; % terminate execution on min/maxvar hit: 0 = warning, 1 = terminate
def.endstop = 3; % Allows x nominal levels higher/lower than the limits before terminating (if def.terminate = 1)
% experimental parameter (independent variable)
def.exppar1 = [0 30 60 90]; % vector containing experimental parameters for which the exp is performed
def.exppar1unit = 'deg'; % unit of experimental parameter
def.exppar1description = 'reference angle';% description of the experimental parameter
% experimental parameter 2...N (independent variable)
% add here if required
% interface, feedback and messages
def.mouse = 1; % enables mouse/touch screen control (1), or disables (0)
def.markinterval = 1; % toggles visual interval marking on (1), off(0)
def.feedback = 1; % visual feedback after response: 0 = no feedback, 1 = correct/false/measurement phase
def.messages = 'default'; % message configuration file, if 'autoSelect' AFC automatically selects depending on expname and language setting, fallback is 'default'. If 'default' or any arbitrary string, the respectively named _msg file is used.
def.language = 'EN'; % EN = english, DE = german, FR = french, DA = danish
% save paths and save function
def.result_path = ''; % where to save results
def.control_path = ''; % where to save control files
def.savefcn = 'default'; % function which writes results to disk
% samplerate and sound output
def.samplerate = 44100; % sampling rate in Hz
def.intervallen = 22050; % length of each signal-presentation interval in samples (might be overloaded in 'expname_set')
def.pauselen = 22050; % length of pauses between signal-presentation intervals in samples (might be overloaded in 'expname_set')
def.presiglen = 100; % length of signal leading the first presentation interval in samples (might be overloaded in 'expname_set')
def.postsiglen = 100; % length of signal following the last presentation interval in samples (might be overloaded in 'expname_set')
def.bits = 16; % output bit depth: 8 or 16 see def.externSoundCommand for 32 bits
% computing
def.allowpredict = 0; % if 1 generate new stimuli during sound output if def.markinterval disabled
% tweaking
%def.keyboardResponseButtonMapping = {'a','s','d'};
%def.soundmexMark = 1;
%def.markinterval = 1;
%def.internSoundCommand = 'sound';
%def.internSoundCommand = 'wavplay';
%def.internSoundCommand = 'audioplayer'; % 'sound' or 'audioplayer'
%def.markIntervalDelay = 0.5; % tweak if audioplayer is used, default is 0
%def.externSoundCommand = '';%'soundmexprofree';
%def.bits = 16;
%def.deviceID = 0;
% eof
% example_set - setup function of experiment 'example' -
%
% This function is called by afc_main when starting
% the experiment 'example'. It defines elements
% of the structure 'setup'. The elements of 'setup' are used
% by the function 'example_user.m'.
%
% If an experiments can be started with different experimental
% conditions, e.g, presentation at different sound preasure levels,
% one might switch between different condition dependent elements
% of structure 'setup' here.
%
% For most experiments it is also suitable to pregenerate some
% stimuli here.
%
% To design an own experiment, e.g., 'myexperiment',
% make changes in this file and save it as 'myexperiment_set.m'.
% Ensure that this function does exist, even if absolutely nothing
% is done here.
%
% See also help example_cfg, example_user, afc_main
function example_set
global def
global work
global setup
% make condition dependend entries in structure set
switch work.condition
case '5deg'
setup.degdiff=5;
case '10deg'
setup.degdiff=10;
otherwise
error('condition not recognized');
end
% define the calibration level (assume 90 dB SPL for 0 dB FS)
work.currentCalLevel = 100;
% % define signals in structure setup
% setup.modsine = sin([0:def.intervallen-1]'*2*pi*work.exppar1/def.samplerate);
% setup.hannlen = round(0.05*def.samplerate);
% setup.window = hannfl(def.intervallen,setup.hannlen,setup.hannlen);
setup.refsig
setup.sigplus
setup.sigminus
% eof
\ No newline at end of file
% example_user - stimulus generation function of experiment 'example' -
%
% This function is called by afc_main when starting
% the experiment 'example'. It generates the stimuli which
% are presented during the experiment.
% The stimuli must be elements of the structure 'work' as follows:
%
% work.signal = def.intervallen by 2 times def.intervalnum matrix.
% The first two columns must contain the test signal
% (column 1 = left, column 2 = right) ...
%
% work.presig = def.presiglen by 2 matrix.
% The pre-signal.
% (column 1 = left, column 2 = right).
%
% work.postsig = def.postsiglen by 2 matrix.
% The post-signal.
% ( column 1 = left, column 2 = right).
%
% work.pausesig = def.pausesiglen by 2 matrix.
% The pause-signal.
% (column 1 = left, column 2 = right).
%
% To design an own experiment, e.g., 'myexperiment',
% make changes in this file and save it as 'myexperiment_user.m'.
% Ensure that the referenced elements of structure 'work' are existing.
%
% See also help example_cfg, example_set, afc_main
function example_user
global def
global work
global setup
% 1000 ... 4000 Hz bandlimited Gaussian noise
% The experiment is meant to be 3-interval 3-alternative forced choice, so we need 3 signals.
% One signal holds the target amplitude modulation.
% work.expvaract holds the current value of the tracking variable of the experiment.
tref1 = real(ifft(scut(fft(randn(def.intervallen,1)),1000,4000,def.samplerate))) * 10^((setup.level - work.currentCalLevel)/20);
tref2 = real(ifft(scut(fft(randn(def.intervallen,1)),1000,4000,def.samplerate))) * 10^((setup.level - work.currentCalLevel)/20);
tuser = real(ifft(scut(fft(randn(def.intervallen,1)),1000,4000,def.samplerate))) * 10^((setup.level - work.currentCalLevel)/20) .* ... // holds the target signal
(1 + (10^(work.expvaract/20) * setup.modsine));
% Hanning windows
tref1 = tref1 .* setup.window;
tref2 = tref2 .* setup.window;
tuser = tuser .* setup.window;
% pre-, post- and pausesignals (all zeros)
presig = zeros(def.presiglen,2);
postsig = zeros(def.postsiglen,2);
pausesig = zeros(def.pauselen,2);
% make required fields in work
work.signal = [tuser tuser tref1 tref1 tref2 tref2]; % left = right (diotic) first two columns holds the test signal (left right)
work.presig = presig; % must contain the presignal
work.postsig = postsig; % must contain the postsignal
work.pausesig = pausesig; % must contain the pausesignal
% eof
\ No newline at end of file
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