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: function sig=gen_complex_damp(orgsig,carriers,halflifes,reprate,amplitudes) tomwalters@0: tomwalters@0: % each combination possible tomwalters@0: grafix=1; tomwalters@0: tomwalters@0: for j=1:length(carriers) tomwalters@0: save_sigs(j)=generatedampsinus(orgsig,carriers(j),reprate(j),amplitudes(j),halflifes(j)); tomwalters@0: tomwalters@0: if j==1 tomwalters@0: gsig=save_sigs(j); tomwalters@0: else tomwalters@0: gsig=gsig+save_sigs(j); tomwalters@0: end tomwalters@0: end tomwalters@0: tomwalters@0: % savewave(tsig,'tsig'); tomwalters@0: tomwalters@0: sig=gsig; tomwalters@0: tomwalters@0: tomwalters@0: tomwalters@0: if grafix tomwalters@0: plot_w=150; tomwalters@0: figure(1) tomwalters@0: clf tomwalters@0: subplot(3,1,[1,2]) tomwalters@0: hold on tomwalters@0: nrc=length(carriers); tomwalters@0: tomwalters@0: % calculate where on the y-axis we are tomwalters@0: minf=100; tomwalters@0: maxf=5000; tomwalters@0: tomwalters@0: tomwalters@0: for i=1:nrc tomwalters@0: f=carriers(i); tomwalters@0: offx=f2f(f,minf,maxf,0,10,'loglin'); tomwalters@0: plot(save_sigs(i)+offx); tomwalters@0: end tomwalters@0: set(gca,'xlim',[0 plot_w]) tomwalters@0: set(gca,'ylim',[0 10]) tomwalters@0: tomwalters@0: yt=[0.1 0.2 0.5 1 2 4]*1000; tomwalters@0: yt2=f2f(yt,minf,maxf,0,10,'loglin'); tomwalters@0: set(gca,'ytick',yt2) tomwalters@0: set(gca,'yticklabel',yt) tomwalters@0: xlabel('') tomwalters@0: ylabel('frequency') tomwalters@0: title('part signals') tomwalters@0: subplot(3,1,3) tomwalters@0: plot(sig); tomwalters@0: set(gca,'xlim',[0 plot_w]) tomwalters@0: title('total signal') tomwalters@0: tomwalters@0: end