tomwalters@0: % tool 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 AIsurface(framestruct_a); tomwalters@0: % plots the current frame (cframe) tomwalters@0: % all relevant data must be in the frame-object tomwalters@0: tomwalters@0: % framestruct.current_frame = current_frame; tomwalters@0: % framestruct.scale_summe = scale_summe; tomwalters@0: % framestruct.maximum_time_interval = maximum_time_interval; in ms!!!! tomwalters@0: % framestruct.minimum_time_interval= minimum_time_interval;in ms!!!! tomwalters@0: % framestruct.is_log='log' or 'linear'; tomwalters@0: tomwalters@0: if ~isstruct(framestruct_a) tomwalters@0: % error('AIsum must be called with a structure'); tomwalters@0: framestruct.current_frame=framestruct_a; tomwalters@0: else tomwalters@0: framestruct=framestruct_a; tomwalters@0: end tomwalters@0: tomwalters@0: if ~isfield(framestruct,'show_time'); tomwalters@0: show_time=1; tomwalters@0: else tomwalters@0: show_time=framestruct.show_time; tomwalters@0: end tomwalters@0: tomwalters@0: if ~isfield(framestruct,'minimum_time_interval'); tomwalters@0: minimum_time_interval=1; tomwalters@0: else tomwalters@0: minimum_time_interval=framestruct.minimum_time_interval; tomwalters@0: end tomwalters@0: tomwalters@0: if ~isfield(framestruct,'maximum_time_interval'); tomwalters@0: maximum_time_interval=35; tomwalters@0: else tomwalters@0: maximum_time_interval=framestruct.maximum_time_interval; tomwalters@0: end tomwalters@0: tomwalters@0: if ~isfield(framestruct,'is_log'); tomwalters@0: is_log=1; tomwalters@0: else tomwalters@0: is_log=framestruct.is_log;; tomwalters@0: end tomwalters@0: current_frame=framestruct.current_frame; tomwalters@0: tomwalters@0: srate=getsr(current_frame); tomwalters@0: if is_log tomwalters@0: tomwalters@0: t=minimum_time_interval; tomwalters@0: ti=[t 2*t 4*t 8*t 16*t 32*t 64*t]; tomwalters@0: tix=(ti)/1000*srate; % there shell be the tix tomwalters@0: tomwalters@0: ti=(ti); tomwalters@0: ti=round(ti*100)/100; tomwalters@0: tomwalters@0: tomwalters@0: min_x_screen=minimum_time_interval/1000*srate; % thats the first point we want to see on the screen tomwalters@0: max_x_screen=maximum_time_interval/1000*srate; % thats the first point we want to see on the screen tomwalters@0: tomwalters@0: else % its not logarithmic! tomwalters@0: nr_labels=8; tomwalters@0: xbis=getnrpoints(summe); tomwalters@0: tix=0:xbis/nr_labels:xbis; tomwalters@0: xstep=(maximum_time_interval-minimum_time_interval)*1000/nr_labels; %works from -35 to 5 tomwalters@0: xstep=round(xstep); tomwalters@0: ti=([minimum_time_interval*1000:xstep:maximum_time_interval*1000]); tomwalters@0: ti=round(ti*10)/10; tomwalters@0: tomwalters@0: min_x_screen=0; tomwalters@0: max_x_screen=maximum_time_interval/1000*srate; % thats the first point we want to see on the screen tomwalters@0: tomwalters@0: end tomwalters@0: % start plotting: tomwalters@0: clf; tomwalters@0: vals=getvalues(current_frame); tomwalters@0: rvals=vals(:,end:-1:1); tomwalters@0: tomwalters@0: h=surf(rvals,'LineStyle','none'); tomwalters@0: view([0 90]); tomwalters@0: shading interp tomwalters@0: % set the position of the axis so that it looks nice tomwalters@0: set(gca,'Position',[0 0.06 0.92 0.96]); tomwalters@0: set(gca,'YAxisLocation','right'); tomwalters@0: tomwalters@0: nr_channels=getnrchannels(current_frame); tomwalters@0: axis([ min_x_screen max_x_screen 1 nr_channels ]); tomwalters@0: tomwalters@0: % axis([min_x_screen max_x_screen 0 scale_summe]); tomwalters@0: tomwalters@0: set(gca,'XDir','reverse') % turn them around, because the higher values shell end on the right tomwalters@0: if is_log tomwalters@0: set(gca,'XScale','log') tomwalters@0: end tomwalters@0: set(gca,'XTick',tix); tomwalters@0: set(gca,'XTickLabel',ti); tomwalters@0: set(gca,'YTickLabel',[]); tomwalters@0: if is_log tomwalters@0: text(min_x_screen*1.9,-200/5,'time interval (ms)'); % this is at a nice position tomwalters@0: else tomwalters@0: text(120,-200/5,'time interval (ms)'); % this is at a nice position tomwalters@0: end tomwalters@0: tomwalters@0: % make y-Ticks tomwalters@0: nr_labels=8; tomwalters@0: ystep=(nr_channels-1)/(nr_labels-1); tomwalters@0: tiy=1:ystep:nr_channels; tomwalters@0: cfs=getcf(current_frame); tomwalters@0: ti=cfs(floor(tiy))/1000; tomwalters@0: ti=round(ti*10)/10; tomwalters@0: set(gca,'YTick',tiy); tomwalters@0: set(gca,'YTickLabel',ti); tomwalters@0: tomwalters@0: text(30,-2,'time interval (ms)'); % this is at a nice position