tomwalters@0: % support file for 'aim-mat' tomwalters@0: % tomwalters@0: % This external file is included as part of the 'aim-mat' distribution package bleeck@3: % (c) 2011, University of Southampton bleeck@3: % Maintained by Stefan Bleeck (bleeck@gmail.com) bleeck@3: % download of current version is on the soundsoftware site: bleeck@3: % http://code.soundsoftware.ac.uk/projects/aimmat bleeck@3: % documentation and everything is on http://www.acousticscale.org tomwalters@0: tomwalters@0: function [stim,wavefilename,stimdir]=loadstimulus(handles,annum,unnum,exnum,sweepnum) tomwalters@0: tomwalters@0: tomwalters@0: tomwalters@0: if nargin==5 % its single electrode tomwalters@0: [extypetotal,experiment_type,ana_tpye]=get_experiment_type(handles,annum,unnum,exnum); tomwalters@0: if strcmp(experiment_type,'aseca') tomwalters@0: stimdir=get_aseca_wave_dir(handles,annum,unnum,exnum); tomwalters@0: idstr=['0000' num2str(sweepnum)]; tomwalters@0: idstr=idstr(end-4:end); tomwalters@0: wavefilename=sprintf('stimid%s.CAP.wav',idstr); tomwalters@0: fullname=fullfile(stimdir,wavefilename); tomwalters@0: else tomwalters@0: exdir=get_experiment_dir(handles,annum,unnum,exnum); tomwalters@0: stimdir=fullfile(exdir,'Saved Stimuli'); tomwalters@0: anstr=num2str(annum); tomwalters@0: unstr=['00' num2str(unnum)]; tomwalters@0: unstr=unstr(end-2:end); tomwalters@0: exstr=['00' num2str(exnum)]; tomwalters@0: exstr=exstr(end-2:end); tomwalters@0: swstr=['000' num2str(sweepnum)]; tomwalters@0: swstr=swstr(end-3:end); tomwalters@0: wavefilename=sprintf('an%sun%sex%sstim%s.wav',anstr,unstr,exstr,swstr); tomwalters@0: fullname=fullfile(stimdir,wavefilename); tomwalters@0: end tomwalters@0: stim=loadwavefile(signal,fullname); tomwalters@0: elseif nargin==4 % its multielectrode tomwalters@0: sweepnum=exnum; tomwalters@0: exnum=unnum; tomwalters@0: exdir=get_meex_dir(handles,annum,exnum); tomwalters@0: stimdir=fullfile(exdir,'Saved Stimuli'); tomwalters@0: anstr=num2str(annum); tomwalters@0: exstr=['000' num2str(exnum)]; tomwalters@0: exstr=exstr(end-3:end); tomwalters@0: swstr=['000' num2str(sweepnum)]; tomwalters@0: swstr=swstr(end-3:end); tomwalters@0: stimname=sprintf('an%sex%sstim%s.wav',anstr,exstr,swstr); tomwalters@0: fullname=fullfile(stimdir,stimname); tomwalters@0: stim=loadwavefile(signal,fullname); tomwalters@0: end tomwalters@0: