Commit f68fb707 authored by Saskia Wepner's avatar Saskia Wepner

starting to tidy up this code: using input paramenters instead of hard-coded file names etc

parent b6fc6c66
function ita_listeningtest_JND() function ita_listeningtest_JND(soundPath, soundPathTrain, fileType)
% <ITA-Toolbox> % <ITA-Toolbox>
...@@ -6,7 +6,7 @@ function ita_listeningtest_JND() ...@@ -6,7 +6,7 @@ function ita_listeningtest_JND()
% You can find the license for this m-file in the application folder. % You can find the license for this m-file in the application folder.
% </ITA-Toolbox> % </ITA-Toolbox>
soundPath = 'Z:\Stimuli\EDT';
% mkdir(soundPath) % mkdir(soundPath)
% morseNumbers = test_mgu_morseCode(); % morseNumbers = test_mgu_morseCode();
% for iNumber = 1:10 % for iNumber = 1:10
...@@ -15,7 +15,7 @@ function ita_listeningtest_JND() ...@@ -15,7 +15,7 @@ function ita_listeningtest_JND()
%% %%
%%% INITIALIZATION OF GUI INPUT DATA %%% INITIALIZATION OF GUI INPUT DATA
br = sprintf('\n'); br = newline;
% General parameters % General parameters
ltData.testName = 'JND Listening Test EDT'; ltData.testName = 'JND Listening Test EDT';
...@@ -27,56 +27,45 @@ ltData.introParameter = [ br br 'Herzlich Willkommen zum H ...@@ -27,56 +27,45 @@ ltData.introParameter = [ br br 'Herzlich Willkommen zum H
'Viel Spa!' 'Viel Spa!'
]; ];
ltData.introAufgabe = [ br br 'Definition:' br br ' Nachhall nennt sich der Schall der in einem Raum, der nach dem ein Ton' br ' pltzlich gestoppt hat, weiterhin besteht.' br br... ltData.introAufgabe = [ br br 'Definition:' br br ' "Nachhall" nennt sich der Schall der in einem Raum, der nach dem ein Ton' br ' pltzlich gestoppt hat, weiterhin besteht.' br br...
'Je lebendiger und lnger der Schall wirkt, desto grer ist der Nachhall.' br 'Je krzer und trockener der Schall wirkt, desto geringer ist der Nachhall.' br br br... 'Je lebendiger und lnger der Schall wirkt, desto grer ist der Nachhall.' br 'Je krzer und trockener der Schall wirkt, desto geringer ist der Nachhall.' br br br...
'Frage:' br br ' In welchem der beiden Beispiele ist der Nachhall strker ausgeprgt?' br br ... 'Frage:' br br ' In welchem der beiden Beispiele ist der Nachhall strker ausgeprgt?' br br ...
]; ];
ltData.txtEndeTraining = [ br 'Das Training ist beendet, der Versuch beginnt jetzt. ' br br ]; ltData.txtEndeTraining = [ br 'Das Training ist beendet, der Versuch beginnt jetzt. ' br br ];
ltData.trainingPath = soundPath; ltData.trainingPath = soundPathTrain;
ltData.trainingFiles = {'Var_EDT K03-R05-P12.ita' 'Var_EDT K04-R04-P01.ita'; ...%3 folderContentTrain = dir(fullfile(ltData.trainingPath, ['*.', fileType])); % only .wav files are considered!
'Var_EDT K02-R05-P02.ita' 'Var_EDT K04-R04-P01.ita'; ...%2 fileNames = {folderContentTrain.name};
'Var_EDT K02-R04-P05.ita' 'Var_EDT K04-R04-P01.ita'; ...%1
'Var_EDT K03-R05-P12_Tr10.ita' 'Var_EDT K04-R04-P01_Tr10.ita'; ...%3 ltData.trainingFiles = {fileNames{1} fileNames{2};
'Var_EDT K02-R05-P02_Tr10.ita' 'Var_EDT K04-R04-P01_Tr10.ita'; ...%2 fileNames{3} fileNames{4};
'Var_EDT K02-R04-P05_Tr10.ita' 'Var_EDT K04-R04-P01_Tr10.ita'; ...%1 };
}; % ltData.trainingFiles = {'Var_EDT K03-R05-P12.ita' 'Var_EDT K04-R04-P01.ita'; ...%3
%ltData.trainingFiles = {'female_1.wav' 'female_2.wav'; ... % 'Var_EDT K02-R05-P02.ita' 'Var_EDT K04-R04-P01.ita'; ...%2
% 'female_3.wav' 'female_4.wav'; ... % 'Var_EDT K02-R04-P05.ita' 'Var_EDT K04-R04-P01.ita'; ...%1
% 'female_6.wav' 'female_7.wav'; ... % 'Var_EDT K03-R05-P12_Tr10.ita' 'Var_EDT K04-R04-P01_Tr10.ita'; ...%3
% 'female_8.wav' 'female_9.wav'; ... % 'Var_EDT K02-R05-P02_Tr10.ita' 'Var_EDT K04-R04-P01_Tr10.ita'; ...%2
% }; % 'Var_EDT K02-R04-P05_Tr10.ita' 'Var_EDT K04-R04-P01_Tr10.ita'; ...%1
% };
ltData.trainingCorrectAnswer = [ 1 1 1 1 1 1 ]; ltData.trainingCorrectAnswer = [ 1 1 1 1 1 1 ];
ltData.compareQuestion = [ br 'In welchem der beiden Beispiele ist der Nachhall strker ausgeprgt?']; ltData.compareQuestion = [ br 'In welchem der beiden Beispiele ist der Nachhall strker ausgeprgt?'];
folderContent = dir(fullfile(ltData.trainingPath, '*.wav')); % only .wav files are considered! % 2do: select file type in "creating GUI"
fileNames = {folderContent.name};
ltData.testPath = soundPath;
ltData.testFiles = {fileNames{1} fileNames{2};
fileNames{3} fileNames{4};
};
ltData.testPath = soundPath;
ltData.testFiles = {'Var_EDT K02-R05-P02.ita' 'Var_EDT K02-R05-P05.ita'; ...
'Var_EDT K01-R05-P02.ita' 'Var_EDT K01-R05-P09.ita'; ...
'Var_EDT K02-R04-P05.ita' 'Var_EDT K03-R05-P12.ita'; ...
'Var_EDT K03-R05-P12.ita' 'Var_EDT K04-R04-P01.ita'; ...
'Var_EDT K02-R05-P02.ita' 'Var_EDT K04-R04-P01.ita'; ...
'Var_EDT K02-R04-P05.ita' 'Var_EDT K04-R04-P01.ita'; ...
'Var_EDT K02-R05-P02_Tr10.ita' 'Var_EDT K02-R05-P05_Tr10.ita'; ...
'Var_EDT K01-R05-P02_Tr10.ita' 'Var_EDT K01-R05-P09_Tr10.ita'; ...
'Var_EDT K02-R04-P05_Tr10.ita' 'Var_EDT K03-R05-P12_Tr10.ita'; ...
'Var_EDT K03-R05-P12_Tr10.ita' 'Var_EDT K04-R04-P01_Tr10.ita'; ...
'Var_EDT K02-R05-P02_Tr10.ita' 'Var_EDT K04-R04-P01_Tr10.ita'; ...
'Var_EDT K02-R04-P05_Tr10.ita' 'Var_EDT K04-R04-P01_Tr10.ita'; ...
};
%ltData.testFiles = {'female_1.wav' 'female_2.wav'; ...
% 'female_3.wav' 'female_4.wav'; ...
% 'female_6.wav' 'female_7.wav'; ...
% 'female_8.wav' 'female_9.wav'; ...
% };
% ltData.testFiles = reshape(ita_sprintf('Morse Code Number %i.ita', 0:9), [], 2); % ltData.testFiles = reshape(ita_sprintf('Morse Code Number %i.ita', 0:9), [], 2);
ltData.pauseBefore = 2; ltData.pauseBefore = 2; % 2do: as input parameter with default value
ltData.pauseBetween = 0.5; ltData.pauseBetween = 0.5; % 2do: as input parameter with default value
ltData.txtEndeTest = [br 'Der Hrversuch endent hier, vielen Dank fr Ihre Teilnahme.']; ltData.txtEndeTest = [br 'Der Hrversuch endent hier, vielen Dank fr Ihre Teilnahme.'];
......
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