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 displaymellin(mellin,options,frame_number) tomwalters@0: tomwalters@0: %setup the scale bar to alter to range of the colour map tomwalters@0: %converts the exponential scale on the scale bar to a value 00) % TCW AIM2006 - fixed divide by zero warnings tomwalters@0: matrix_of_current_frame = matrix_of_current_frame / max(max(matrix_of_current_frame)); tomwalters@0: end tomwalters@0: tomwalters@0: % % maah: Maybe a threshold can help against this blur! tomwalters@0: % if (options.threshold ~= 0) tomwalters@0: % if (options.threshold ~= 1) tomwalters@0: % matrix_of_current_frame(matrix_of_current_frame < options.threshold) = 0; tomwalters@0: % else tomwalters@0: % mean_value = mean(mean(matrix_of_current_frame)); tomwalters@0: % matrix_of_current_frame(matrix_of_current_frame < mean_value) = 0; tomwalters@0: % end; tomwalters@0: % end; tomwalters@0: tomwalters@0: %set the range of values for the axes tomwalters@0: coef_range=[0,max(options.c_2pi)]; tomwalters@0: h_range=[0,max(options.TFval)]; tomwalters@0: tomwalters@0: %set the resolution of the axes tomwalters@0: coef_step=(coef_range(1,2)-coef_range(1,1))/10; tomwalters@0: %h_step=(h_range(1,2)-h_range(1,1))/10; tomwalters@0: h_step=1; tomwalters@0: tomwalters@0: %sets the axis divisions tomwalters@0: coef_axis = [coef_range(1,1):coef_step:coef_range(1,2)]; tomwalters@0: h_axis = [h_range(1,1):h_step:h_range(1,2)]; tomwalters@0: tomwalters@0: %this section sets up the colormap to be the correct gray scale version that we want tomwalters@0: colormap_name=gray(128); % maah: was = gray(128) tomwalters@0: size_colormap=size(colormap_name); tomwalters@0: %disp(size_colormap); tomwalters@0: for ii=1:size_colormap(1); tomwalters@0: rich_map(ii,:)=colormap_name((129-ii),:); tomwalters@0: end; tomwalters@0: colormap(rich_map); tomwalters@0: tomwalters@0: tomwalters@0: %now we generate the image matlab automatically scales the colours tomwalters@0: %note that we take the magnitude of the components tomwalters@0: %we reset the the colourmap, scaling it's maximum to 1 tomwalters@0: %matrix_of_current_frame = matrix_of_current_frame'; %removed the transpose tomwalters@0: %in the display function and put it into the generating function tomwalters@0: mellin_image = image(h_axis, coef_axis, matrix_of_current_frame,'CDataMapping','scaled'); tomwalters@0: tomwalters@0: set(gca,'CLimMode','manual'); tomwalters@0: set(gca,'CLim',[0 options.max_value]); tomwalters@0: tomwalters@0: %now we scale the image so that it fills the display area tomwalters@0: limitx=ceil(max(h_axis)); tomwalters@0: limity=ceil(max(coef_axis)); tomwalters@0: set(gca,'XLim',[0 limitx]); tomwalters@0: set(gca,'YLim',[0 limity]); tomwalters@0: tomwalters@0: %here we setup the scale and location of the axes tomwalters@0: set(gca,'XTick', h_axis); tomwalters@0: set(gca,'XTickLabel', h_axis,'FontSize',8); tomwalters@0: tomwalters@0: set(gca,'YTick', coef_axis); tomwalters@0: set(gca,'YTickLabel', coef_axis,'FontSize',8,'YAxisLocation','right'); tomwalters@0: tomwalters@0: %flip the y axis tomwalters@0: set(gca,'YDir','normal') tomwalters@0: tomwalters@0: %and put on the labels tomwalters@0: mellin_image = xlabel('Time-Interval, Peak-Frequency product, \ith','FontSize',8); tomwalters@0: mellin_image = ylabel('Mellin variable, \it{c/2\pi}','FontSize',8);