tomwalters@0: % generating function for 'aim-mat' tomwalters@0: % tomwalters@0: % INPUT VALUES: tomwalters@0: % tomwalters@0: % RETURN VALUE: tomwalters@0: % tomwalters@0: % 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 bleeck@3: tomwalters@0: tomwalters@0: function usermodule=gendualprofile(sai,options) tomwalters@0: tomwalters@0: % find out about scaling: tomwalters@0: maxval=-inf; tomwalters@0: maxfreval=-inf; tomwalters@0: maxsumval=-inf; tomwalters@0: tomwalters@0: nr_frames=length(sai); tomwalters@0: for ii=1:nr_frames tomwalters@0: maxval=max([maxval getmaximumvalue(sai{ii})]); tomwalters@0: maxsumval=max([maxsumval getscalesumme(sai{ii})]); tomwalters@0: maxfreval=max([maxfreval getscalefrequency(sai{ii})]); tomwalters@0: end tomwalters@0: tomwalters@0: waithand = waitbar(0,'Generating dualprofile with peak detection'); tomwalters@0: for frame_number=1:nr_frames tomwalters@0: tomwalters@0: waitbar(frame_number/nr_frames, waithand); tomwalters@0: tomwalters@0: current_frame = sai{frame_number}; tomwalters@0: current_frame = setallmaxvalue(current_frame, maxval); tomwalters@0: current_frame = setscalesumme(current_frame, maxsumval); tomwalters@0: current_frame = setscalefrequency(current_frame, maxfreval); tomwalters@0: tomwalters@0: usermodule{frame_number}.interval_sum = getsum(current_frame); tomwalters@0: usermodule{frame_number}.frequency_sum = getfrequencysum(current_frame); tomwalters@0: usermodule{frame_number}.channel_center_fq = getcf(sai{frame_number}); tomwalters@0: end tomwalters@0: close(waithand);