Commit cad36303 authored by Lukas Aspöck's avatar Lukas Aspöck
Browse files

loadRavenConfig now includes additional checks for input data (HRTFs etc.)

parent eecb9902
......@@ -468,6 +468,43 @@ classdef itaRavenProject < handle
obj.spreadingStdDeviation = obj.rpf_ini.GetValues('Filter', 'spreadingStdDeviation', 0.2);
obj.fftDegreeForWallFilterInterpolation = obj.rpf_ini.GetValues('Filter', 'fftDegreeForWallFilterInterpolation', 8);
%% check input data files (HRTF, source directivity, room model)
% HRTF (also shows if DAFF file is v15 or v17)
if (exist(obj.fileHRTF,'file') == 0)
warning('HRTF file not found at the specified location.');
else
if (contains(obj.fileHRTF,'.v17.daff'))
disp('itaRavenProject: Loaded DAFFv17 HRTF file');
end
if (contains(obj.fileHRTF,'.v15.daff'))
disp('itaRavenProject: Loaded DAFFv15 HRTF file');
end
end
% Source directivity (only checks first directivity file)
if (~isempty(obj.sourceDirectivity)) % first check if any directivity was defined
if (exist([ obj.pathDirectivities '\' obj.sourceDirectivity{1}],'file') == 0)
warning('Source directivity file not found at the specified location.');
else
if (contains(obj.sourceDirectivity{1},'.v17.daff'))
disp('itaRavenProject: Loaded DAFFv17 source directivity file');
end
if (contains(obj.sourceDirectivity{1},'.v15.daff'))
disp('itaRavenProject: Loaded DAFFv15 source directivity file');
end
end
end
% room model
if (numel(obj.modelFileList) == 0 )
warning('No room model file (*.ac) specified in project file.');
end
if (numel(obj.modelFileList) == 1 && exist(obj.modelFileList,'file') == 0)
warning('Room model file (*.ac) not found at the specified location.');
end
obj.projectLoaded = true;
end
......@@ -1917,7 +1954,7 @@ classdef itaRavenProject < handle
end
%------------------------------------------------------------------
function setFilterLength(obj, filter_length)
function setFilterLength(obj, filter_length)
% set filter length in ms
if filter_length < 3
filter_length = filter_length * 1000;
......@@ -3921,6 +3958,8 @@ classdef itaRavenProject < handle
edc = {edc};
end
%% Important note: This only works if you do not use a source directivity file
for iRec = 1 : size(edc,2)
% Strength G
G{iRec} = 10 * log10( edc{sourceID+1,iRec}(1,:) / (1/100) ); % 1/100 = energy of direct sound per frequency band for 10m distance
......@@ -5548,7 +5587,7 @@ classdef itaRavenProject < handle
obj.setOutputPath(oldPath);
end
%------------------------------------------------------------------
%------------------------------------------------------------------
function monoIR = getMonauralImpulseResponse(obj)
if isempty(obj.monoIR)
error('No mono room impulse response present.');
......
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