# HG changeset patch # User Chris Cannam # Date 1393852612 0 # Node ID ffc4d61e9538697f644c828f7b83b1bd0341a6e7 # Parent fcb75c4045c2d9a396a39f63db6ad0c819e6d47f Make input directory a parameter as well diff -r fcb75c4045c2 -r ffc4d61e9538 simulateBinauralSignals.m --- a/simulateBinauralSignals.m Fri Feb 28 15:10:36 2014 +0000 +++ b/simulateBinauralSignals.m Mon Mar 03 13:16:52 2014 +0000 @@ -15,7 +15,11 @@ % .outdir (5th input argument) must be the directory in which the wave file % is to be written. It may be an absolute path, or relative to the current % directory. Temporary files will be written in the same directory. -% .outname (6th input argument) must be the name of the wave file to write, within the outdir, without the .wav suffix (which will be added). +% .outname (6th input argument) must be the name of the wave file to write, +% within the outdir, without the .wav suffix (which will be added). +% .indir (7th input argument) must be the directory from which input data +% such as IR files are to be read. It may be an absolute path, or relative +% to the current directory. % %% Internal workings description @@ -113,6 +117,7 @@ dirweight = inputstruct.dirweight; outdir = inputstruct.outdir; outname = inputstruct.outname; +indir = inputstruct.indir; %% Validate attributes validateattributes(dist,{'double'},{'scalar','>',0}) @@ -121,6 +126,7 @@ validateattributes(dirweight,{'double'},{'scalar','>',0}) validateattributes(outdir,{'char'},{'nonempty'}) validateattributes(outname,{'char'},{'nonempty'}) +validateattributes(indir,{'char'},{'nonempty'}) %% Computation parameters (Some fixed, some taken from input arguments) params.board_size_x = .55; @@ -227,7 +233,7 @@ %% Compute binaural IRs -temp = load('hrir_final.mat'); %This is subject_165 CIPIC data +temp = load([indir filesep 'hrir_final.mat']); %This is subject_165 CIPIC data h3D_lear = temp.hrir_l; h3D_rear = temp.hrir_r; clear temp @@ -485,9 +491,6 @@ end end -disp(['Names before ' names_bef]); -disp(['Names after ' names_aft]); - %get irtot for 1st source 1st receiver and delete files created by %computation. % for n=1:length(names_aft) @@ -501,7 +504,6 @@ % end % end for n=1:length(names_aft) - disp(['name is ' names_aft(n)]); if ~strcmp(names_aft(n),names_bef) if ~isempty(strfind(names_aft{n},'_1_1_ir.mat')) temp=load([outdir filesep names_aft{n}]);