www.gusucode.com > 声音的处理有:LPC,FFT,共振峰,频谱源码程序 > siganlandsystemusingMatlab/SSUM/birds/old/birdsgui.m
function varargout = birdsgui(varargin) Figure_Name='Additive Synthesis Forest'; % [x, cmap] = imread('forest_backdrop.gif'); % [button, bcmap] = imread('bird.jpg'); load 'forest.mat'; figure('name',Figure_Name,'number','off',... 'Position',[100 100 size(x,2)*1.1 size(x,1)*1.1],'MenuBar','none'); h_axis=axes('pos',[0 0 1 1]); image(x); axis image; colormap(cmap); hold on; top = 70; delta = 30; offset = 15; h_offset = -20; text_left = 64; n = 1; birds = {'Yellow_Warbler', 'Western_Meadowlark', 'Orchard_Oriole',... 'Chipping_Sparrow', 'Scissor_Tailed_Flycatcher',... 'Black_Throated_Gray_Warbler', 'Cassins_Kingbird',... 'Black_Necked_Stilt', 'Chestnut_Sided_Warbler',... 'Great_Horned_Owl', 'Grasshopper_Sparrow', 'Swamp_Sparrow',... 'Golden_Crowned_Sparrow', 'Indigo_Bunting', 'Robin',... 'Nashville_Warbler', 'Rufous_Sided_Towhee', 'Random_Bird'}; switch computer case {'GLNX86','MAC'} birdfontsize = 12; titlesize = 24; authorsize = 14; case 'PCWIN' birdfontsize = 10; titlesize = 18; authorsize = 12; end y = -35; text(52.5,y+60,'Additive Synthesis Forest',... 'fontsize',titlesize,... 'fontweight','bold',... 'color',[0.5 0.9 0.8]); text(66.5,y+80,'by Bob L. Sturm and Dr. Jerry Gibson',... 'fontsize',authorsize,... 'fontweight','bold',... 'color',[0.5 0.9 0.8]); for i=1:length(birds), if (mod(i,10) == 0) h_offset = h_offset + 200; n = 1; end buttoncommand = ['hbutton' num2str(i) ' = image(button,''xdata'',[35+h_offset:57+h_offset],' ... '''ydata'',[top+' num2str(n) '*delta,top+' num2str(n) '*delta+20],'... '''button'',''birdcall(''''' birds{i} ''''')'');']; %textcommand = ['text(text_left+h_offset,top+' num2str(n) '*delta+offset,''' strrep(birds{i},'_',' ') ''',''fontname'',''times'',''fontsize'',12,''fontweight'',''bold'',''color'',[1 0.9 1]);']; textcommand = ['text(text_left+h_offset,top+' num2str(n) '*delta+offset,''' strrep(birds{i},'_',' ') ''',''fontsize'',' num2str(birdfontsize) ',''fontweight'',''bold'',''color'',[1 0.9 1]);']; eval(buttoncommand); eval(textcommand); n = n+1; end set(h_axis,'visible','off');