tomwalters@0: % tool tomwalters@0: % tomwalters@0: % INPUT VALUES: tomwalters@0: % tomwalters@0: % RETURN VALUE: tomwalters@0: % tomwalters@0: % bleeck@3: % 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: tomwalters@0: fundamental=125; tomwalters@0: fc=[500 1000 2000]; tomwalters@0: tomwalters@0: % bandwidthtype='linear'; tomwalters@0: bandwidthtype='linear'; tomwalters@0: bandwidth_first=2000; tomwalters@0: bandwidth_scale=2.2; tomwalters@0: tomwalters@0: tomwalters@0: phase=[50 80]; tomwalters@0: amplitude=[-4 -10]; tomwalters@0: tomwalters@0: tomwalters@0: nr_amps=size(amplitude,2); tomwalters@0: nr_fre=size(fc,2); tomwalters@0: nr_phase=size(phase,2); tomwalters@0: tomwalters@0: bandwidth=bandwidth_first; tomwalters@0: tomwalters@0: for i=1:nr_fre tomwalters@0: fcs=fc(i); tomwalters@0: tomwalters@0: % name=sprintf('sound(cf=%4.0f,bw=%4.0f)',fcs,bandwidth); tomwalters@0: name=sprintf('PAsdgsdgsound(cf=%4.0f,bw=%4.0f)',fcs,bandwidth); tomwalters@0: s=sprintf('genharmonics(signal(0.5,16000),''fundamental'',''%f'',''filterprop'',[%f 256 %f 512]);',fundamental,fcs,bandwidth); tomwalters@0: ss=sprintf('%s=%s','tsig',s); tomwalters@0: eval(ss); tomwalters@0: tsig=scaletorms(tsig,0.1); tomwalters@0: tsig=rampamplitude(tsig,0.05); tomwalters@0: writetowavefile(tsig,name); tomwalters@0: return tomwalters@0: tomwalters@0: str_amp='decreaseoddamplitude'; tomwalters@0: for j=1:nr_amps tomwalters@0: changeby=amplitude(j); tomwalters@0: name=sprintf('sound(cf=%4.0f,amp=%3.0f,bw=%4.0f)',fcs,changeby,bandwidth); tomwalters@0: 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: ss=sprintf('%s=%s','tsig',s); tomwalters@0: eval(ss); tomwalters@0: tsig=scaletorms(tsig,0.1); tomwalters@0: tsig=rampamplitude(tsig,0.05); tomwalters@0: writetowavefile(tsig,name); tomwalters@0: end tomwalters@0: tomwalters@0: str_amp='decreaseoddphase'; tomwalters@0: for j=1:nr_phase tomwalters@0: changeby=phase(j); tomwalters@0: name=sprintf('sound(cf=%4.0f,phase=%3.0f,bw=%4.0f)',fcs,changeby,bandwidth); tomwalters@0: 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: ss=sprintf('%s=%s','tsig',s); tomwalters@0: eval(ss); tomwalters@0: tsig=scaletorms(tsig,0.1); tomwalters@0: tsig=rampamplitude(tsig,0.05); tomwalters@0: writetowavefile(tsig,name); tomwalters@0: end tomwalters@0: tomwalters@0: if strcmp(bandwidthtype,'linear') tomwalters@0: bandwidth=bandwidth_first; tomwalters@0: else tomwalters@0: bandwidth=bandwidth*bandwidth_scale; tomwalters@0: end tomwalters@0: tomwalters@0: end tomwalters@0: