www.gusucode.com > 声音的处理有:LPC,FFT,共振峰,频谱源码程序 > siganlandsystemusingMatlab/SSUM/speech/vq/vqexpogui.m
function varargout = vqexpogui(varargin) % VQEXPOGUI M-file for vqexpogui.fig % VQEXPOGUI, by itself, creates a new VQEXPOGUI or raises the existing % singleton*. % % H = VQEXPOGUI returns the handle to a new VQEXPOGUI or the handle to % the existing singleton*. % % VQEXPOGUI('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in VQEXPOGUI.M with the given input arguments. % % VQEXPOGUI('Property','Value',...) creates a new VQEXPOGUI or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before vqexpogui_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to vqexpogui_OpeningFcn via varargin. % % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one % instance to run (singleton)". % % See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help vqexpogui % Last Modified by GUIDE v2.5 31-Mar-2005 09:54:52 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @vqexpogui_OpeningFcn, ... 'gui_OutputFcn', @vqexpogui_OutputFcn, ... 'gui_LayoutFcn', @vqexpogui_LayoutFcn, ... 'gui_Callback', []); if nargin & isstr(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end % End initialization code - DO NOT EDIT % --- Executes just before vqexpogui is made visible. function vqexpogui_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to vqexpogui (see VARARGIN) % Choose default command line output for vqexpogui handles.output = hObject; guidata(hObject, handles); set(gcf,'UserData',handles); vqexpofn; if (nargin > 3) datastruct = varargin{1}; vqexpofn('readinput',datastruct); end % --- Outputs from this function are returned to the command line. function varargout = vqexpogui_OutputFcn(hObject, eventdata, handles) varargout{1} = handles.output; % -------------------------------------------------------------------- function FileMenu_Callback(hObject, eventdata, handles) % -------------------------------------------------------------------- function PrintMenuItem_Callback(hObject, eventdata, handles) vqexpofn 'print'; % -------------------------------------------------------------------- function CloseMenuItem_Callback(hObject, eventdata, handles) vqexpofn 'close'; % --- Executes on button press in print. function print_Callback(hObject, eventdata, handles) vqexpofn 'print'; % -------------------------------------------------------------------- function Untitled_1_Callback(hObject, eventdata, handles) % hObject handle to Untitled_1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % -------------------------------------------------------------------- function fourier_Callback(hObject, eventdata, handles) % hObject handle to fourier (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) vqexpofn 'fourier'; % -------------------------------------------------------------------- function alias_Callback(hObject, eventdata, handles) % hObject handle to alias (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) vqexpofn 'alias'; % -------------------------------------------------------------------- function help_Callback(hObject, eventdata, handles) % hObject handle to help (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) vqexpofn 'help'; % -------------------------------------------------------------------- function feature_Callback(hObject, eventdata, handles) % hObject handle to feature (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) vqexpofn 'feature'; % -------------------------------------------------------------------- function formantexpo_Callback(hObject, eventdata, handles) % hObject handle to formantexpo (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) vqexpofn 'formantexpo'; % -------------------------------------------------------------------- function lpcexpo_Callback(hObject, eventdata, handles) % hObject handle to lpcexpo (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) vqexpofn 'lpcexpo'; % --- Executes when vqexpogui_fig window is resized. function vqexpogui_fig_ResizeFcn(hObject, eventdata, handles) % hObject handle to vqexpogui_fig (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) vqexpofn 'resize'; % --- Executes on button press in play. function play_Callback(hObject, eventdata, handles) % hObject handle to play (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) vqexpofn 'play'; % -------------------------------------------------------------------- function Untitled_3_Callback(hObject, eventdata, handles) % hObject handle to Untitled_3 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % -------------------------------------------------------------------- function load_Callback(hObject, eventdata, handles) % hObject handle to load (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) vqexpofn 'load'; % --- Executes on selection change in datatype. function datatype_Callback(hObject, eventdata, handles) % hObject handle to datatype (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns datatype contents as cell array % contents{get(hObject,'Value')} returns selected item from datatype vqexpofn 'updatePlot'; % --- Executes during object creation, after setting all properties. function datatype_CreateFcn(hObject, eventdata, handles) % hObject handle to datatype (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function info_Callback(hObject, eventdata, handles) % hObject handle to info (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of info as text % str2double(get(hObject,'String')) returns contents of info as a double % --- Executes during object creation, after setting all properties. function info_CreateFcn(hObject, eventdata, handles) % hObject handle to info (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function windowsize_Callback(hObject, eventdata, handles) % hObject handle to windowsize (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of windowsize as text % str2double(get(hObject,'String')) returns contents of windowsize as a double val = abs(str2num(get(hObject,'String'))); set(hObject,'String',num2str(val)); vqexpofn 'analysischange'; % --- Executes during object creation, after setting all properties. function windowsize_CreateFcn(hObject, eventdata, handles) % hObject handle to windowsize (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function windowskip_Callback(hObject, eventdata, handles) % hObject handle to windowskip (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of windowskip as text % str2double(get(hObject,'String')) returns contents of windowskip as a double val = abs(str2num(get(hObject,'String'))); set(hObject,'String',num2str(val)); vqexpofn 'analysischange'; % --- Executes during object creation, after setting all properties. function windowskip_CreateFcn(hObject, eventdata, handles) % hObject handle to windowskip (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on button press in show_codebook. function show_codebook_Callback(hObject, eventdata, handles) % hObject handle to show_codebook (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of show_codebook vqexpofn 'updatePlot'; % --- Executes on button press in show_errors. function show_errors_Callback(hObject, eventdata, handles) % hObject handle to show_errors (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) vqexpofn 'show_errors'; % --- Executes on button press in analyze. function analyze_Callback(hObject, eventdata, handles) % hObject handle to analyze (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) vqexpofn 'analyze'; % --- Executes on button press in original_vectors. function original_vectors_Callback(hObject, eventdata, handles) % hObject handle to original_vectors (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of original_vectors vqexpofn 'updatePlot'; % --- Executes on selection change in codebooksize. function codebooksize_Callback(hObject, eventdata, handles) % hObject handle to codebooksize (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns codebooksize contents as cell array % contents{get(hObject,'Value')} returns selected item from codebooksize vqexpofn 'updatePlot'; % --- Executes during object creation, after setting all properties. function codebooksize_CreateFcn(hObject, eventdata, handles) % hObject handle to codebooksize (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on button press in findcodebook. function findcodebook_Callback(hObject, eventdata, handles) % hObject handle to findcodebook (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) function epsilon_Callback(hObject, eventdata, handles) % hObject handle to epsilon (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of epsilon as text % str2double(get(hObject,'String')) returns contents of epsilon as a double % --- Executes during object creation, after setting all properties. function epsilon_CreateFcn(hObject, eventdata, handles) % hObject handle to epsilon (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function error_thresh_Callback(hObject, eventdata, handles) % hObject handle to error_thresh (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of error_thresh as text % str2double(get(hObject,'String')) returns contents of error_thresh as a double % --- Executes during object creation, after setting all properties. function error_thresh_CreateFcn(hObject, eventdata, handles) % hObject handle to error_thresh (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on button press in findvq. function findvq_Callback(hObject, eventdata, handles) % hObject handle to findvq (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) vqexpofn 'analyze'; % --- Creates and returns a handle to the GUI figure. function h1 = vqexpogui_LayoutFcn(policy) % policy - create a new figure or use a singleton. 'new' or 'reuse'. persistent hsingleton; if strcmpi(policy, 'reuse') & ishandle(hsingleton) h1 = hsingleton; return; end appdata = []; appdata.GUIDEOptions = struct(... 'active_h', [], ... 'taginfo', struct(... 'figure', 2, ... 'axes', 7, ... 'pushbutton', 24, ... 'popupmenu', 12, ... 'listbox', 2, ... 'text', 33, ... 'slider', 3, ... 'checkbox', 8, ... 'radiobutton', 5, ... 'edit', 13, ... 'uipanel', 3), ... 'override', 1, ... 'release', 13, ... 'resize', 'simple', ... 'accessibility', 'callback', ... 'mfile', 1, ... 'callbacks', 1, ... 'singleton', 1, ... 'syscolorfig', 1, ... 'lastSavedFile', '/Users/bobsturm/SSUM/speech/vq/vqexpogui.m', ... 'blocking', 0); appdata.lastValidTag = 'vqexpo_fig'; appdata.GUIDELayoutEditor = []; h1 = figure(... 'Units','characters',... 'Color',[0.701960784313725 0.701960784313725 0.701960784313725],... 'Colormap',[0 0 0.5625;0 0 0.625;0 0 0.6875;0 0 0.75;0 0 0.8125;0 0 0.875;0 0 0.9375;0 0 1;0 0.0625 1;0 0.125 1;0 0.1875 1;0 0.25 1;0 0.3125 1;0 0.375 1;0 0.4375 1;0 0.5 1;0 0.5625 1;0 0.625 1;0 0.6875 1;0 0.75 1;0 0.8125 1;0 0.875 1;0 0.9375 1;0 1 1;0.0625 1 1;0.125 1 0.9375;0.1875 1 0.875;0.25 1 0.8125;0.3125 1 0.75;0.375 1 0.6875;0.4375 1 0.625;0.5 1 0.5625;0.5625 1 0.5;0.625 1 0.4375;0.6875 1 0.375;0.75 1 0.3125;0.8125 1 0.25;0.875 1 0.1875;0.9375 1 0.125;1 1 0.0625;1 1 0;1 0.9375 0;1 0.875 0;1 0.8125 0;1 0.75 0;1 0.6875 0;1 0.625 0;1 0.5625 0;1 0.5 0;1 0.4375 0;1 0.375 0;1 0.3125 0;1 0.25 0;1 0.1875 0;1 0.125 0;1 0.0625 0;1 0 0;0.9375 0 0;0.875 0 0;0.8125 0 0;0.75 0 0;0.6875 0 0;0.625 0 0;0.5625 0 0],... 'DockControls','off',... 'IntegerHandle','off',... 'InvertHardcopy',get(0,'defaultfigureInvertHardcopy'),... 'MenuBar','none',... 'Name','Vector Quantization Explorer',... 'NumberTitle','off',... 'PaperOrientation','landscape',... 'PaperPosition',get(0,'defaultfigurePaperPosition'),... 'PaperSize',[11 8.5],... 'Pointer','crosshair',... 'Position',[1 9.61538461538461 127.6 61.1538461538462],... 'Renderer',get(0,'defaultfigureRenderer'),... 'RendererMode','manual',... 'HandleVisibility','callback',... 'Tag','vqexpo_fig',... 'UserData',[],... 'Behavior',get(0,'defaultfigureBehavior'),... 'Visible','on',... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'FileMenu'; h2 = uimenu(... 'Parent',h1,... 'Callback','vqexpogui(''FileMenu_Callback'',gcbo,[],guidata(gcbo))',... 'Label','File',... 'Tag','FileMenu',... 'Behavior',get(0,'defaultuimenuBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'load'; h3 = uimenu(... 'Parent',h2,... 'Callback','vqexpogui(''load_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Load Speech',... 'Tag','load',... 'Behavior',get(0,'defaultuimenuBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'CloseMenuItem'; h4 = uimenu(... 'Parent',h2,... 'Callback','vqexpogui(''CloseMenuItem_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Close',... 'Separator','on',... 'Tag','CloseMenuItem',... 'Behavior',get(0,'defaultuimenuBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'vectorplot'; h5 = axes(... 'Parent',h1,... 'Position',[0.0862068965517241 0.295597484276729 0.893416927899687 0.693081761006289],... 'ALim',get(0,'defaultaxesALim'),... 'ALimMode','manual',... 'CameraPosition',[0.5 0.5 9.16025403784439],... 'CameraPositionMode','manual',... 'CameraTarget',[0.5 0.5 0.5],... 'CameraTargetMode','manual',... 'CameraUpVector',[0 1 0],... 'CameraUpVectorMode','manual',... 'CameraViewAngle',6.60861036031192,... 'CameraViewAngleMode','manual',... 'CLim',get(0,'defaultaxesCLim'),... 'CLimMode','manual',... 'Color',get(0,'defaultaxesColor'),... 'ColorOrder',get(0,'defaultaxesColorOrder'),... 'DataAspectRatio',get(0,'defaultaxesDataAspectRatio'),... 'DataAspectRatioMode','manual',... 'LooseInset',[0.173130841121495 0.142325581395349 0.126518691588785 0.0970401691331924],... 'PlotBoxAspectRatio',get(0,'defaultaxesPlotBoxAspectRatio'),... 'PlotBoxAspectRatioMode','manual',... 'TickDir',get(0,'defaultaxesTickDir'),... 'TickDirMode','manual',... 'XColor',get(0,'defaultaxesXColor'),... 'XLim',get(0,'defaultaxesXLim'),... 'XLimMode','manual',... 'XTick',[0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1],... 'XTickLabel',{ '0 '; '0.1'; '0.2'; '0.3'; '0.4'; '0.5'; '0.6'; '0.7'; '0.8'; '0.9'; '1 ' },... 'XTickLabelMode','manual',... 'XTickMode','manual',... 'YColor',get(0,'defaultaxesYColor'),... 'YLim',get(0,'defaultaxesYLim'),... 'YLimMode','manual',... 'YTick',[0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1],... 'YTickLabel',{ '0 '; '0.1'; '0.2'; '0.3'; '0.4'; '0.5'; '0.6'; '0.7'; '0.8'; '0.9'; '1 ' },... 'YTickLabelMode','manual',... 'YTickMode','manual',... 'ZColor',get(0,'defaultaxesZColor'),... 'ZLim',get(0,'defaultaxesZLim'),... 'ZLimMode','manual',... 'ZTick',[0 0.5 1],... 'ZTickLabel','',... 'ZTickLabelMode','manual',... 'ZTickMode','manual',... 'Tag','vectorplot',... 'UserData',[],... 'Behavior',get(0,'defaultaxesBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); h6 = get(h5,'title'); set(h6,... 'Parent',h5,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0 0 0],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',10,... 'FontWeight','normal',... 'HorizontalAlignment','center',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[0.49901768172888 1.01080550098232 1.00005459937205],... 'Rotation',0,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','bottom',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','on',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); h7 = get(h5,'xlabel'); set(h7,... 'Parent',h5,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0 0 0],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',10,... 'FontWeight','normal',... 'HorizontalAlignment','center',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[0.49901768172888 -0.0383104125736737 1.00005459937205],... 'Rotation',0,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','cap',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','on',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); h8 = get(h5,'ylabel'); set(h8,... 'Parent',h5,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0 0 0],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',10,... 'FontWeight','normal',... 'HorizontalAlignment','center',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[-0.0471512770137523 0.49803536345776 1.00005459937205],... 'Rotation',90,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','bottom',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','on',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); h9 = get(h5,'zlabel'); set(h9,... 'Parent',h5,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0 0 0],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',10,... 'FontWeight','normal',... 'HorizontalAlignment','right',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[-0.302554027504911 1.01277013752456 1.00005459937205],... 'Rotation',0,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','middle',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','off',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); appdata = []; appdata.lastValidTag = 'Untitled_1'; h10 = uimenu(... 'Parent',h1,... 'Callback','vqexpogui(''Untitled_1_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Send to ...',... 'Tag','Untitled_1',... 'Behavior',get(0,'defaultuimenuBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'alias'; h11 = uimenu(... 'Parent',h10,... 'Callback','vqexpogui(''alias_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Aliasing Explorer',... 'Tag','alias',... 'Behavior',get(0,'defaultuimenuBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'feature'; h12 = uimenu(... 'Parent',h10,... 'Callback','vqexpogui(''feature_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Feature Explorer',... 'Tag','feature',... 'Behavior',get(0,'defaultuimenuBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'firexpo'; h13 = uimenu(... 'Parent',h10,... 'Callback','vqexpogui(''firexpo_Callback'',gcbo,[],guidata(gcbo))',... 'Label','FIR Filter Explorer',... 'Tag','firexpo',... 'Behavior',get(0,'defaultuimenuBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'formantexpo'; h14 = uimenu(... 'Parent',h10,... 'Callback','vqexpogui(''formantexpo_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Formant Explorer',... 'Tag','formantexpo',... 'Behavior',get(0,'defaultuimenuBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'fourier'; h15 = uimenu(... 'Parent',h10,... 'Callback','vqexpogui(''fourier_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Fourier Explorer',... 'Tag','fourier',... 'Behavior',get(0,'defaultuimenuBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'iirexpo'; h16 = uimenu(... 'Parent',h10,... 'Callback','vqexpogui(''iirexpo_Callback'',gcbo,[],guidata(gcbo))',... 'Label','IIR Filter Explorer',... 'Tag','iirexpo',... 'Behavior',get(0,'defaultuimenuBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'lpcexpo'; h17 = uimenu(... 'Parent',h10,... 'Callback','vqexpogui(''lpcexpo_Callback'',gcbo,[],guidata(gcbo))',... 'Label','LPC Explorer',... 'Tag','lpcexpo',... 'Behavior',get(0,'defaultuimenuBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'help'; h18 = uimenu(... 'Parent',h1,... 'Callback','vqexpogui(''help_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Help',... 'Tag','help',... 'Behavior',get(0,'defaultuimenuBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uipanel1'; h19 = uipanel(... 'Parent',h1,... 'Units','characters',... 'Title','Analysis',... 'Position',[13 0.608974358974375 33 14.9230769230769],... 'Tag','uipanel1',... 'Behavior',get(0,'defaultuipanelBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'windowsize'; h20 = uicontrol(... 'Parent',h19,... 'Units','characters',... 'BackgroundColor',[1 1 1],... 'Callback','vqexpogui(''windowsize_Callback'',gcbo,[],guidata(gcbo))',... 'Position',[17.2 7.92307692307692 7 1.53846153846154],... 'String','40',... 'Style','edit',... 'CreateFcn', {@local_CreateFcn, 'vqexpogui(''windowsize_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,... 'Tag','windowsize',... 'Behavior',get(0,'defaultuicontrolBehavior')); appdata = []; appdata.lastValidTag = 'windowskip'; h21 = uicontrol(... 'Parent',h19,... 'Units','characters',... 'BackgroundColor',[1 1 1],... 'Callback','vqexpogui(''windowskip_Callback'',gcbo,[],guidata(gcbo))',... 'Position',[17.2 5.76923076923077 7 1.53846153846154],... 'String','10',... 'Style','edit',... 'CreateFcn', {@local_CreateFcn, 'vqexpogui(''windowskip_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,... 'Tag','windowskip',... 'Behavior',get(0,'defaultuicontrolBehavior')); appdata = []; appdata.lastValidTag = 'text19'; h22 = uicontrol(... 'Parent',h19,... 'Units','characters',... 'HorizontalAlignment','right',... 'Position',[1.5 7.75641025641026 14 1.5],... 'String','Window Size',... 'Style','text',... 'Tag','text19',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text20'; h23 = uicontrol(... 'Parent',h19,... 'Units','characters',... 'HorizontalAlignment','right',... 'Position',[1.5 5.58974358974359 14 1.5],... 'String','Window Skip',... 'Style','text',... 'Tag','text20',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text21'; h24 = uicontrol(... 'Parent',h19,... 'Units','characters',... 'HorizontalAlignment','left',... 'Position',[25.4 7.76923076923077 6 1.53846153846154],... 'String','(ms)',... 'Style','text',... 'Tag','text21',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text23'; h25 = uicontrol(... 'Parent',h19,... 'Units','characters',... 'HorizontalAlignment','left',... 'Position',[25.4 5.61538461538461 6 1.53846153846154],... 'String','(ms)',... 'Style','text',... 'Tag','text23',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text16'; h26 = uicontrol(... 'Parent',h19,... 'Units','characters',... 'HorizontalAlignment','left',... 'Position',[3.33333333333333 11.7564102564103 14 1.5],... 'String','Vector Type',... 'Style','text',... 'Tag','text16',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'datatype'; h27 = uicontrol(... 'Parent',h19,... 'Units','characters',... 'BackgroundColor',[1 1 1],... 'Callback','vqexpogui(''datatype_Callback'',gcbo,[],guidata(gcbo))',... 'Position',[3.33333333333333 10.0897435897436 18.3333333333333 1.5],... 'String',{ 'Cepstrum'; 'MFCC'; 'LPC' },... 'Style','popupmenu',... 'Value',1,... 'CreateFcn', {@local_CreateFcn, 'vqexpogui(''datatype_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,... 'Tag','datatype',... 'Behavior',get(0,'defaultuicontrolBehavior')); appdata = []; appdata.lastValidTag = 'analyze'; h28 = uicontrol(... 'Parent',h19,... 'Units','characters',... 'Callback','vqexpogui(''analyze_Callback'',gcbo,[],guidata(gcbo))',... 'Position',[20.1666666666667 0.58974358974359 10 1.5],... 'String','Analyze',... 'Tag','analyze',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'play'; h29 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','vqexpogui(''play_Callback'',gcbo,[],guidata(gcbo))',... 'Position',[78 5.76282051282053 6 1.53846153846154],... 'String','Play',... 'Tag','play',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text17'; h30 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Position',[57.4 13.7628205128205 20 1.53846153846154],... 'String','Speech Information',... 'Style','text',... 'Tag','text17',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'info'; h31 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'BackgroundColor',[1 1 1],... 'Callback','vqexpogui(''info_Callback'',gcbo,[],guidata(gcbo))',... 'HorizontalAlignment','left',... 'Max',5,... 'Position',[50 7.99358974358976 35 6],... 'String','',... 'Style','edit',... 'CreateFcn', {@local_CreateFcn, 'vqexpogui(''info_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,... 'Tag','info',... 'Behavior',get(0,'defaultuicontrolBehavior')); appdata = []; appdata.lastValidTag = 'uipanel2'; h32 = uipanel(... 'Parent',h1,... 'Units','characters',... 'Title','Vector Quantization',... 'Position',[88 0.608974358974375 33 14.9230769230769],... 'Tag','uipanel2',... 'Behavior',get(0,'defaultuipanelBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'show_codebook'; h33 = uicontrol(... 'Parent',h32,... 'Units','characters',... 'Callback','vqexpogui(''show_codebook_Callback'',gcbo,[],guidata(gcbo))',... 'CData',[],... 'Position',[3.16666666666667 2.33333333333333 20 1.41666666666667],... 'String','Codebook',... 'Style','checkbox',... 'Tag','show_codebook',... 'UserData',[],... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'show_errors'; h34 = uicontrol(... 'Parent',h32,... 'Units','characters',... 'Callback','vqexpogui(''show_errors_Callback'',gcbo,[],guidata(gcbo))',... 'Position',[16.3333333333333 0.756410256410257 13 1.5],... 'String','Plot Errors',... 'Tag','show_errors',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'original_vectors'; h35 = uicontrol(... 'Parent',h32,... 'Units','characters',... 'Callback','vqexpogui(''original_vectors_Callback'',gcbo,[],guidata(gcbo))',... 'CData',[],... 'Position',[3.16666666666667 4.17307692307692 20 1.41666666666667],... 'String','Original Vectors',... 'Style','checkbox',... 'Value',1,... 'Tag','original_vectors',... 'UserData',[],... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text30'; h36 = uicontrol(... 'Parent',h32,... 'Units','characters',... 'HorizontalAlignment','left',... 'Position',[3.33333333333333 11.4230769230769 15 1.5],... 'String','Codebook Size',... 'Style','text',... 'Tag','text30',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'codebooksize'; h37 = uicontrol(... 'Parent',h32,... 'Units','characters',... 'BackgroundColor',[1 1 1],... 'Callback','vqexpogui(''codebooksize_Callback'',gcbo,[],guidata(gcbo))',... 'Position',[3.33333333333333 10.0064102564103 9 1.5],... 'String',{ '1'; '2'; '4'; '8'; '16'; '32'; '64' },... 'Style','popupmenu',... 'Value',1,... 'CreateFcn', {@local_CreateFcn, 'vqexpogui(''codebooksize_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,... 'Tag','codebooksize',... 'Behavior',get(0,'defaultuicontrolBehavior')); appdata = []; appdata.lastValidTag = 'epsilon'; h38 = uicontrol(... 'Parent',h32,... 'Units','characters',... 'BackgroundColor',[1 1 1],... 'Callback','vqexpogui(''epsilon_Callback'',gcbo,[],guidata(gcbo))',... 'Position',[11.8 8.15384615384616 7 1.53846153846154],... 'String','0.01',... 'Style','edit',... 'CreateFcn', {@local_CreateFcn, 'vqexpogui(''epsilon_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,... 'Tag','epsilon',... 'Behavior',get(0,'defaultuicontrolBehavior')); appdata = []; appdata.lastValidTag = 'text31'; h39 = uicontrol(... 'Parent',h32,... 'Units','characters',... 'HorizontalAlignment','right',... 'Position',[2.8 8 8 1.53846153846154],... 'String','Epsilon',... 'Style','text',... 'Tag','text31',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'error_thresh'; h40 = uicontrol(... 'Parent',h32,... 'Units','characters',... 'BackgroundColor',[1 1 1],... 'Callback','vqexpogui(''error_thresh_Callback'',gcbo,[],guidata(gcbo))',... 'Position',[11.8 6.07692307692308 7 1.53846153846154],... 'String','0.01',... 'Style','edit',... 'CreateFcn', {@local_CreateFcn, 'vqexpogui(''error_thresh_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,... 'Tag','error_thresh',... 'Behavior',get(0,'defaultuicontrolBehavior')); appdata = []; appdata.lastValidTag = 'text32'; h41 = uicontrol(... 'Parent',h32,... 'Units','characters',... 'HorizontalAlignment','right',... 'Position',[0.8 5.84615384615385 10 2.23076923076923],... 'String',{ 'Error'; 'Threshold' },... 'Style','text',... 'Tag','text32',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'findvq'; h42 = uicontrol(... 'Parent',h32,... 'Units','characters',... 'Callback','vqexpogui(''findvq_Callback'',gcbo,[],guidata(gcbo))',... 'Position',[19.6 6.92307692307692 12 1.53846153846154],... 'String','Recompute',... 'Tag','findvq',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); hsingleton = h1; % --- Set application data first then calling the CreateFcn. function local_CreateFcn(hObject, eventdata, createfcn, appdata) if ~isempty(appdata) names = fieldnames(appdata); for i=1:length(names) name = char(names(i)); setappdata(hObject, name, getfield(appdata,name)); end end if ~isempty(createfcn) eval(createfcn); end % --- Handles default GUIDE GUI creation and callback dispatch function varargout = gui_mainfcn(gui_State, varargin) gui_StateFields = {'gui_Name' 'gui_Singleton' 'gui_OpeningFcn' 'gui_OutputFcn' 'gui_LayoutFcn' 'gui_Callback'}; gui_Mfile = ''; for i=1:length(gui_StateFields) if ~isfield(gui_State, gui_StateFields{i}) error('Could not find field %s in the gui_State struct in GUI M-file %s', gui_StateFields{i}, gui_Mfile); elseif isequal(gui_StateFields{i}, 'gui_Name') gui_Mfile = [gui_State.(gui_StateFields{i}), '.m']; end end numargin = length(varargin); if numargin == 0 % VQEXPOGUI % create the GUI gui_Create = 1; elseif isequal(ishandle(varargin{1}), 1) && ispc && iscom(varargin{1}) && isequal(varargin{1},gcbo) % VQEXPOGUI(ACTIVEX,...) vin{1} = gui_State.gui_Name; vin{2} = [get(varargin{1}.Peer, 'Tag'), '_', varargin{end}]; vin{3} = varargin{1}; vin{4} = varargin{end-1}; vin{5} = guidata(varargin{1}.Peer); feval(vin{:}); return; elseif ischar(varargin{1}) && numargin>1 && isequal(ishandle(varargin{2}), 1) % VQEXPOGUI('CALLBACK',hObject,eventData,handles,...) gui_Create = 0; else % VQEXPOGUI(...) % create the GUI and hand varargin to the openingfcn gui_Create = 1; end if gui_Create == 0 varargin{1} = gui_State.gui_Callback; if nargout [varargout{1:nargout}] = feval(varargin{:}); else feval(varargin{:}); end else if gui_State.gui_Singleton gui_SingletonOpt = 'reuse'; else gui_SingletonOpt = 'new'; end % Open fig file with stored settings. Note: This executes all component % specific CreateFunctions with an empty HANDLES structure. % Do feval on layout code in m-file if it exists if ~isempty(gui_State.gui_LayoutFcn) gui_hFigure = feval(gui_State.gui_LayoutFcn, gui_SingletonOpt); % openfig (called by local_openfig below) does this for guis without % the LayoutFcn. Be sure to do it here so guis show up on screen. movegui(gui_hFigure,'onscreen') else gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt); % If the figure has InGUIInitialization it was not completely created % on the last pass. Delete this handle and try again. if isappdata(gui_hFigure, 'InGUIInitialization') delete(gui_hFigure); gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt); end end % Set flag to indicate starting GUI initialization setappdata(gui_hFigure,'InGUIInitialization',1); % Fetch GUIDE Application options gui_Options = getappdata(gui_hFigure,'GUIDEOptions'); if ~isappdata(gui_hFigure,'GUIOnScreen') % Adjust background color if gui_Options.syscolorfig set(gui_hFigure,'Color', get(0,'DefaultUicontrolBackgroundColor')); end % Generate HANDLES structure and store with GUIDATA guidata(gui_hFigure, guihandles(gui_hFigure)); end % If user specified 'Visible','off' in p/v pairs, don't make the figure % visible. gui_MakeVisible = 1; for ind=1:2:length(varargin) if length(varargin) == ind break; end len1 = min(length('visible'),length(varargin{ind})); len2 = min(length('off'),length(varargin{ind+1})); if ischar(varargin{ind}) && ischar(varargin{ind+1}) && ... strncmpi(varargin{ind},'visible',len1) && len2 > 1 if strncmpi(varargin{ind+1},'off',len2) gui_MakeVisible = 0; elseif strncmpi(varargin{ind+1},'on',len2) gui_MakeVisible = 1; end end end % Check for figure param value pairs for index=1:2:length(varargin) if length(varargin) == index || ~ischar(varargin{index}) break; end try set(gui_hFigure, varargin{index}, varargin{index+1}), catch break, end end % If handle visibility is set to 'callback', turn it on until finished % with OpeningFcn gui_HandleVisibility = get(gui_hFigure,'HandleVisibility'); if strcmp(gui_HandleVisibility, 'callback') set(gui_hFigure,'HandleVisibility', 'on'); end feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:}); if ishandle(gui_hFigure) % Update handle visibility set(gui_hFigure,'HandleVisibility', gui_HandleVisibility); % Make figure visible if gui_MakeVisible set(gui_hFigure, 'Visible', 'on') if gui_Options.singleton setappdata(gui_hFigure,'GUIOnScreen', 1); end end % Done with GUI initialization rmappdata(gui_hFigure,'InGUIInitialization'); end % If handle visibility is set to 'callback', turn it on until finished with % OutputFcn if ishandle(gui_hFigure) gui_HandleVisibility = get(gui_hFigure,'HandleVisibility'); if strcmp(gui_HandleVisibility, 'callback') set(gui_hFigure,'HandleVisibility', 'on'); end gui_Handles = guidata(gui_hFigure); else gui_Handles = []; end if nargout [varargout{1:nargout}] = feval(gui_State.gui_OutputFcn, gui_hFigure, [], gui_Handles); else feval(gui_State.gui_OutputFcn, gui_hFigure, [], gui_Handles); end if ishandle(gui_hFigure) set(gui_hFigure,'HandleVisibility', gui_HandleVisibility); end end function gui_hFigure = local_openfig(name, singleton) % openfig with three arguments was new from R13. Try to call that first, if % failed, try the old openfig. try gui_hFigure = openfig(name, singleton, 'auto'); catch % OPENFIG did not accept 3rd input argument until R13, % toggle default figure visible to prevent the figure % from showing up too soon. gui_OldDefaultVisible = get(0,'defaultFigureVisible'); set(0,'defaultFigureVisible','off'); gui_hFigure = openfig(name, singleton); set(0,'defaultFigureVisible',gui_OldDefaultVisible); end