tomwalters@0
|
1 % support file for 'aim-mat'
|
tomwalters@0
|
2 %
|
tomwalters@0
|
3 % This external file is included as part of the 'aim-mat' distribution package
|
bleeck@3
|
4 % (c) 2011, University of Southampton
|
bleeck@3
|
5 % Maintained by Stefan Bleeck (bleeck@gmail.com)
|
bleeck@3
|
6 % download of current version is on the soundsoftware site:
|
bleeck@3
|
7 % http://code.soundsoftware.ac.uk/projects/aimmat
|
bleeck@3
|
8 % documentation and everything is on http://www.acousticscale.org
|
tomwalters@0
|
9
|
tomwalters@0
|
10 function [stim,wavefilename,stimdir]=loadstimulus(handles,annum,unnum,exnum,sweepnum)
|
tomwalters@0
|
11
|
tomwalters@0
|
12
|
tomwalters@0
|
13
|
tomwalters@0
|
14 if nargin==5 % its single electrode
|
tomwalters@0
|
15 [extypetotal,experiment_type,ana_tpye]=get_experiment_type(handles,annum,unnum,exnum);
|
tomwalters@0
|
16 if strcmp(experiment_type,'aseca')
|
tomwalters@0
|
17 stimdir=get_aseca_wave_dir(handles,annum,unnum,exnum);
|
tomwalters@0
|
18 idstr=['0000' num2str(sweepnum)];
|
tomwalters@0
|
19 idstr=idstr(end-4:end);
|
tomwalters@0
|
20 wavefilename=sprintf('stimid%s.CAP.wav',idstr);
|
tomwalters@0
|
21 fullname=fullfile(stimdir,wavefilename);
|
tomwalters@0
|
22 else
|
tomwalters@0
|
23 exdir=get_experiment_dir(handles,annum,unnum,exnum);
|
tomwalters@0
|
24 stimdir=fullfile(exdir,'Saved Stimuli');
|
tomwalters@0
|
25 anstr=num2str(annum);
|
tomwalters@0
|
26 unstr=['00' num2str(unnum)];
|
tomwalters@0
|
27 unstr=unstr(end-2:end);
|
tomwalters@0
|
28 exstr=['00' num2str(exnum)];
|
tomwalters@0
|
29 exstr=exstr(end-2:end);
|
tomwalters@0
|
30 swstr=['000' num2str(sweepnum)];
|
tomwalters@0
|
31 swstr=swstr(end-3:end);
|
tomwalters@0
|
32 wavefilename=sprintf('an%sun%sex%sstim%s.wav',anstr,unstr,exstr,swstr);
|
tomwalters@0
|
33 fullname=fullfile(stimdir,wavefilename);
|
tomwalters@0
|
34 end
|
tomwalters@0
|
35 stim=loadwavefile(signal,fullname);
|
tomwalters@0
|
36 elseif nargin==4 % its multielectrode
|
tomwalters@0
|
37 sweepnum=exnum;
|
tomwalters@0
|
38 exnum=unnum;
|
tomwalters@0
|
39 exdir=get_meex_dir(handles,annum,exnum);
|
tomwalters@0
|
40 stimdir=fullfile(exdir,'Saved Stimuli');
|
tomwalters@0
|
41 anstr=num2str(annum);
|
tomwalters@0
|
42 exstr=['000' num2str(exnum)];
|
tomwalters@0
|
43 exstr=exstr(end-3:end);
|
tomwalters@0
|
44 swstr=['000' num2str(sweepnum)];
|
tomwalters@0
|
45 swstr=swstr(end-3:end);
|
tomwalters@0
|
46 stimname=sprintf('an%sex%sstim%s.wav',anstr,exstr,swstr);
|
tomwalters@0
|
47 fullname=fullfile(stimdir,stimname);
|
tomwalters@0
|
48 stim=loadwavefile(signal,fullname);
|
tomwalters@0
|
49 end
|
tomwalters@0
|
50
|