annotate aim-mat/tools/makeall.m @ 4:537f939baef0 tip

various bug fixes and changed copyright message
author Stefan Bleeck <bleeck@gmail.com>
date Tue, 16 Aug 2011 14:37:17 +0100
parents 20ada0af3d7d
children
rev   line source
tomwalters@0 1 % tool
tomwalters@0 2 %
tomwalters@0 3 % INPUT VALUES:
tomwalters@0 4 %
tomwalters@0 5 % RETURN VALUE:
tomwalters@0 6 %
tomwalters@0 7 %
bleeck@3 8 % This external file is included as part of the 'aim-mat' distribution package
bleeck@3 9 % (c) 2011, University of Southampton
bleeck@3 10 % Maintained by Stefan Bleeck (bleeck@gmail.com)
bleeck@3 11 % download of current version is on the soundsoftware site:
bleeck@3 12 % http://code.soundsoftware.ac.uk/projects/aimmat
bleeck@3 13 % documentation and everything is on http://www.acousticscale.org
tomwalters@0 14
tomwalters@0 15
tomwalters@0 16 fundamental=125;
tomwalters@0 17 fc=[500 1000 2000];
tomwalters@0 18
tomwalters@0 19 % bandwidthtype='linear';
tomwalters@0 20 bandwidthtype='linear';
tomwalters@0 21 bandwidth_first=2000;
tomwalters@0 22 bandwidth_scale=2.2;
tomwalters@0 23
tomwalters@0 24
tomwalters@0 25 phase=[50 80];
tomwalters@0 26 amplitude=[-4 -10];
tomwalters@0 27
tomwalters@0 28
tomwalters@0 29 nr_amps=size(amplitude,2);
tomwalters@0 30 nr_fre=size(fc,2);
tomwalters@0 31 nr_phase=size(phase,2);
tomwalters@0 32
tomwalters@0 33 bandwidth=bandwidth_first;
tomwalters@0 34
tomwalters@0 35 for i=1:nr_fre
tomwalters@0 36 fcs=fc(i);
tomwalters@0 37
tomwalters@0 38 % name=sprintf('sound(cf=%4.0f,bw=%4.0f)',fcs,bandwidth);
tomwalters@0 39 name=sprintf('PAsdgsdgsound(cf=%4.0f,bw=%4.0f)',fcs,bandwidth);
tomwalters@0 40 s=sprintf('genharmonics(signal(0.5,16000),''fundamental'',''%f'',''filterprop'',[%f 256 %f 512]);',fundamental,fcs,bandwidth);
tomwalters@0 41 ss=sprintf('%s=%s','tsig',s);
tomwalters@0 42 eval(ss);
tomwalters@0 43 tsig=scaletorms(tsig,0.1);
tomwalters@0 44 tsig=rampamplitude(tsig,0.05);
tomwalters@0 45 writetowavefile(tsig,name);
tomwalters@0 46 return
tomwalters@0 47
tomwalters@0 48 str_amp='decreaseoddamplitude';
tomwalters@0 49 for j=1:nr_amps
tomwalters@0 50 changeby=amplitude(j);
tomwalters@0 51 name=sprintf('sound(cf=%4.0f,amp=%3.0f,bw=%4.0f)',fcs,changeby,bandwidth);
tomwalters@0 52 s=sprintf('genharmonics(signal(0.5,16000),''fundamental'',''%f'',''type'',''%s'',''changeby'',''%f'',''filterprop'',[%f 256 %f 512]);',fundamental,str_amp,changeby,fcs,bandwidth);
tomwalters@0 53 ss=sprintf('%s=%s','tsig',s);
tomwalters@0 54 eval(ss);
tomwalters@0 55 tsig=scaletorms(tsig,0.1);
tomwalters@0 56 tsig=rampamplitude(tsig,0.05);
tomwalters@0 57 writetowavefile(tsig,name);
tomwalters@0 58 end
tomwalters@0 59
tomwalters@0 60 str_amp='decreaseoddphase';
tomwalters@0 61 for j=1:nr_phase
tomwalters@0 62 changeby=phase(j);
tomwalters@0 63 name=sprintf('sound(cf=%4.0f,phase=%3.0f,bw=%4.0f)',fcs,changeby,bandwidth);
tomwalters@0 64 s=sprintf('genharmonics(signal(0.5,16000),''fundamental'',''%f'',''type'',''%s'',''changeby'',''%f'',''filterprop'',[%f 256 %f 512]);',fundamental,str_amp,changeby,fcs,bandwidth);
tomwalters@0 65 ss=sprintf('%s=%s','tsig',s);
tomwalters@0 66 eval(ss);
tomwalters@0 67 tsig=scaletorms(tsig,0.1);
tomwalters@0 68 tsig=rampamplitude(tsig,0.05);
tomwalters@0 69 writetowavefile(tsig,name);
tomwalters@0 70 end
tomwalters@0 71
tomwalters@0 72 if strcmp(bandwidthtype,'linear')
tomwalters@0 73 bandwidth=bandwidth_first;
tomwalters@0 74 else
tomwalters@0 75 bandwidth=bandwidth*bandwidth_scale;
tomwalters@0 76 end
tomwalters@0 77
tomwalters@0 78 end
tomwalters@0 79