www.gusucode.com > 声音的处理有:LPC,FFT,共振峰,频谱源码程序 > siganlandsystemusingMatlab/SSUM/xsynthesis/xsynthexpogui.m
function varargout = xsynthexpogui(varargin) % XSYNTHEXPOGUI M-file for xsynthexpogui.fig % XSYNTHEXPOGUI, by itself, creates a new XSYNTHEXPOGUI or raises the existing % singleton*. % % H = XSYNTHEXPOGUI returns the handle to a new XSYNTHEXPOGUI or the handle to % the existing singleton*. % % XSYNTHEXPOGUI('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in XSYNTHEXPOGUI.M with the given input arguments. % % XSYNTHEXPOGUI('Property','Value',...) creates a new XSYNTHEXPOGUI or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before xsynthexpogui_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to xsynthexpogui_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 xsynthexpogui % Last Modified by GUIDE v2.5 25-Mar-2004 20:52:55 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @xsynthexpogui_OpeningFcn, ... 'gui_OutputFcn', @xsynthexpogui_OutputFcn, ... 'gui_LayoutFcn', @xsynthexpogui_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 xsynthexpogui is made visible. function xsynthexpogui_OpeningFcn(hObject, eventdata, handles, varargin) % Choose default command line output for xsynthexpogui handles.output = hObject; % Update handles structure guidata(hObject, handles); set(gcf,'UserData',handles); xsynthexpofn; % --- Outputs from this function are returned to the command line. function varargout = xsynthexpogui_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles.output; % -------------------------------------------------------------------- function load_signal_1_Callback(hObject, eventdata, handles) handles = get(gcf,'UserData'); handles.signum = 1; set(gcf,'UserData',handles); xsynthexpofn 'loadsound' % -------------------------------------------------------------------- function load_signal_2_Callback(hObject, eventdata, handles) handles = get(gcf,'UserData'); handles.signum = 2; set(gcf,'UserData',handles); xsynthexpofn 'loadsound' % -------------------------------------------------------------------- function write_soundfile_Callback(hObject, eventdata, handles) xsynthexpofn 'write_soundfile' % --- Executes on button press in dB. function dB_Callback(hObject, eventdata, handles) xsynthexpofn 'db' % --- Executes during object creation, after setting all properties. function fftsize_CreateFcn(hObject, eventdata, handles) if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on selection change in fftsize. function fftsize_Callback(hObject, eventdata, handles) xsynthexpofn 'fftsize' % --- Executes on button press in zoomout. function zoomout_Callback(hObject, eventdata, handles) % --- Executes on button press in zoomout. function crosssynthesis_Callback(hObject, eventdata, handles) % --- Executes on button press in zoomout. function File_Callback(hObject, eventdata, handles) % --- Executes during object creation, after setting all properties. function window_CreateFcn(hObject, eventdata, handles) if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on selection change in window. function window_Callback(hObject, eventdata, handles) xsynthexpofn 'window' % --- Executes during object creation, after setting all properties. function colormap_CreateFcn(hObject, eventdata, handles) if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on selection change in colormap. function colormap_Callback(hObject, eventdata, handles) xsynthexpofn 'colormap' % --- Executes on button press in inverse. function inverse_Callback(hObject, eventdata, handles) xsynthexpofn 'inverse' % --- Executes on button press in interpolate. function interpolate_Callback(hObject, eventdata, handles) xsynthexpofn 'interpolate' % --- Executes on button press in s1_play. function s1_play_Callback(hObject, eventdata, handles) handles = get(gcf,'UserData'); handles.signum = 1; set(gcf,'UserData',handles); xsynthexpofn 'play' % --- Executes on button press in s2_play. function s2_play_Callback(hObject, eventdata, handles) handles = get(gcf,'UserData'); handles.signum = 2; set(gcf,'UserData',handles); xsynthexpofn 'play' % --- Executes on button press in s3_play. function s3_play_Callback(hObject, eventdata, handles) handles = get(gcf,'UserData'); handles.signum = 3; set(gcf,'UserData',handles); xsynthexpofn 'play' % -------------------------------------------------------------------- function openworkspace_Callback(hObject, eventdata, handles) xsynthexpofn 'loadworkspace' % -------------------------------------------------------------------- function saveworkspace_Callback(hObject, eventdata, handles) xsynthexpofn 'saveworkspace' function convolution_Callback(hObject, eventdata, handles) xsynthexpofn 'convolution' function amplitudenvelope_Callback(hObject, eventdata, handles) xsynthexpofn 'ampenv' function lpc_Callback(hObject, eventdata, handles) xsynthexpofn 'lpc' % --- Executes during object creation, after setting all properties. function text1_CreateFcn(hObject, eventdata, handles) % hObject handle to text1 (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function text1_Callback(hObject, eventdata, handles) % hObject handle to text1 (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 text1 as text % str2double(get(hObject,'String')) returns contents of text1 as a double % --- Executes during object creation, after setting all properties. function text2_CreateFcn(hObject, eventdata, handles) % hObject handle to text2 (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function text2_Callback(hObject, eventdata, handles) % hObject handle to text2 (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 text2 as text % str2double(get(hObject,'String')) returns contents of text2 as a double % --- Executes during object creation, after setting all properties. function text3_CreateFcn(hObject, eventdata, handles) % hObject handle to text3 (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function text3_Callback(hObject, eventdata, handles) % hObject handle to text3 (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 text3 as text % str2double(get(hObject,'String')) returns contents of text3 as a double % --- Executes during object creation, after setting all properties. function freqzoom_CreateFcn(hObject, eventdata, handles) % hObject handle to freqzoom (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: slider controls usually have a light gray background, change % 'usewhitebg' to 0 to use default. See ISPC and COMPUTER. usewhitebg = 1; if usewhitebg set(hObject,'BackgroundColor',[.9 .9 .9]); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on slider movement. function freqzoom_Callback(hObject, eventdata, handles) % hObject handle to freqzoom (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,'Value') returns position of slider % get(hObject,'Min') and get(hObject,'Max') to determine range of slider xsynthexpofn 'freqzoom'; % -------------------------------------------------------------------- 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) xsynthexpofn 'help'; % -------------------------------------------------------------------- function print_Callback(hObject, eventdata, handles) % hObject handle to print (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) xsynthexpofn 'print'; % -------------------------------------------------------------------- function close_Callback(hObject, eventdata, handles) % hObject handle to close (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) xsynthexpofn 'close'; % --- Executes on button press in load_signal_1. function load1_Callback(hObject, eventdata, handles) % hObject handle to load_signal_1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % --- Executes on button press in load_signal_2. function load2_Callback(hObject, eventdata, handles) % hObject handle to load_signal_2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % --- Executes on button press in zoomreset. function zoomreset_Callback(hObject, eventdata, handles) % hObject handle to zoomreset (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) xsynthexpofn 'zoomreset'; % --- Creates and returns a handle to the GUI figure. function h1 = xsynthexpogui_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 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],... 'IntegerHandle','off',... 'InvertHardcopy',get(0,'defaultfigureInvertHardcopy'),... 'MenuBar','none',... 'Name','Cross Synthesis Explorer',... 'NumberTitle','off',... 'PaperPosition',[0.25 2.5 15 6],... 'Position',[103.8 15.2115384615385 212.6 55],... 'Renderer',get(0,'defaultfigureRenderer'),... 'RendererMode','manual',... 'HandleVisibility','callback',... 'Tag','xsynthexpo_fig',... 'UserData',[]); setappdata(h1, 'GUIDEOptions',struct(... 'active_h', [], ... 'taginfo', struct(... 'figure', 2, ... 'axes', 7, ... 'text', 13, ... 'checkbox', 4, ... 'pushbutton', 10, ... 'popupmenu', 5, ... 'frame', 2, ... 'edit', 5, ... 'slider', 2), ... 'override', 1, ... 'release', 13, ... 'resize', 'simple', ... 'accessibility', 'callback', ... 'mfile', 1, ... 'callbacks', 1, ... 'singleton', 1, ... 'syscolorfig', 1, ... 'lastSavedFile', '/Users/bobsturm/gibson/SSUM.PC/xsynthesis/xsynthexpo.m', ... 'blocking', 0)); h2 = axes(... 'Parent',h1,... 'Units','characters',... 'CameraPosition',[0.5 0.5 9.16025403784439],... 'CameraPositionMode',get(0,'defaultaxesCameraPositionMode'),... 'Color',get(0,'defaultaxesColor'),... 'ColorOrder',get(0,'defaultaxesColorOrder'),... 'Position',[10.6 30.7692307692308 65 20.6923076923077],... 'XColor',get(0,'defaultaxesXColor'),... 'YColor',get(0,'defaultaxesYColor'),... 'ZColor',get(0,'defaultaxesZColor'),... 'Tag','sig_1_spec'); h3 = get(h2,'title'); set(h3,... 'Parent',h2,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[0.498397435897436 1.026 1.00005459937205],... 'VerticalAlignment','bottom',... 'HandleVisibility','off'); h4 = get(h2,'xlabel'); set(h4,... 'Parent',h2,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[0.498397435897436 -0.0940000000000001 1.00005459937205],... 'VerticalAlignment','cap',... 'HandleVisibility','off'); h5 = get(h2,'ylabel'); set(h5,... 'Parent',h2,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[-0.0753205128205128 0.494 1.00005459937205],... 'Rotation',90,... 'VerticalAlignment','bottom',... 'HandleVisibility','off'); h6 = get(h2,'zlabel'); set(h6,... 'Parent',h2,... 'Color',[0 0 0],... 'HorizontalAlignment','right',... 'Position',[-0.184294871794872 1.158 1.00005459937205],... 'HandleVisibility','off',... 'Visible','off'); h7 = axes(... 'Parent',h1,... 'Units','characters',... 'CameraPosition',[0.5 0.5 9.16025403784439],... 'CameraPositionMode',get(0,'defaultaxesCameraPositionMode'),... 'Color',get(0,'defaultaxesColor'),... 'ColorOrder',get(0,'defaultaxesColorOrder'),... 'Position',[76.6 30.7692307692308 65 20.6923076923077],... 'XColor',get(0,'defaultaxesXColor'),... 'YColor',get(0,'defaultaxesYColor'),... 'ZColor',get(0,'defaultaxesZColor'),... 'Tag','sig_2_spec'); h8 = get(h7,'title'); set(h8,... 'Parent',h7,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[0.498397435897436 1.026 1.00005459937205],... 'VerticalAlignment','bottom',... 'HandleVisibility','off'); h9 = get(h7,'xlabel'); set(h9,... 'Parent',h7,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[0.498397435897436 -0.0940000000000001 1.00005459937205],... 'VerticalAlignment','cap',... 'HandleVisibility','off'); h10 = get(h7,'ylabel'); set(h10,... 'Parent',h7,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[-0.0753205128205128 0.494 1.00005459937205],... 'Rotation',90,... 'VerticalAlignment','bottom',... 'HandleVisibility','off'); h11 = get(h7,'zlabel'); set(h11,... 'Parent',h7,... 'Color',[0 0 0],... 'HorizontalAlignment','right',... 'Position',[-1.19391025641026 1.158 1.00005459937205],... 'HandleVisibility','off',... 'Visible','off'); h12 = axes(... 'Parent',h1,... 'Units','characters',... 'CameraPosition',[0.5 0.5 9.16025403784439],... 'CameraPositionMode',get(0,'defaultaxesCameraPositionMode'),... 'Color',get(0,'defaultaxesColor'),... 'ColorOrder',get(0,'defaultaxesColorOrder'),... 'Position',[142.6 30.7692307692308 65 20.6923076923077],... 'XColor',get(0,'defaultaxesXColor'),... 'YColor',get(0,'defaultaxesYColor'),... 'ZColor',get(0,'defaultaxesZColor'),... 'Tag','sig_3_spec'); h13 = get(h12,'title'); set(h13,... 'Parent',h12,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[0.498397435897436 1.026 1.00005459937205],... 'VerticalAlignment','bottom',... 'HandleVisibility','off'); h14 = get(h12,'xlabel'); set(h14,... 'Parent',h12,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[0.498397435897436 -0.0940000000000001 1.00005459937205],... 'VerticalAlignment','cap',... 'HandleVisibility','off'); h15 = get(h12,'ylabel'); set(h15,... 'Parent',h12,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[-0.0753205128205128 0.494 1.00005459937205],... 'Rotation',90,... 'VerticalAlignment','bottom',... 'HandleVisibility','off'); h16 = get(h12,'zlabel'); set(h16,... 'Parent',h12,... 'Color',[0 0 0],... 'HorizontalAlignment','right',... 'Position',[-2.20673076923077 1.158 1.00005459937205],... 'HandleVisibility','off',... 'Visible','off'); h17 = axes(... 'Parent',h1,... 'Units','characters',... 'CameraPosition',[0.5 0.5 9.16025403784439],... 'CameraPositionMode',get(0,'defaultaxesCameraPositionMode'),... 'Color',get(0,'defaultaxesColor'),... 'ColorOrder',get(0,'defaultaxesColorOrder'),... 'Position',[10.6 17.3846153846154 65 12.4615384615385],... 'XColor',get(0,'defaultaxesXColor'),... 'YColor',get(0,'defaultaxesYColor'),... 'ZColor',get(0,'defaultaxesZColor'),... 'Tag','sig_1_time'); h18 = get(h17,'title'); set(h18,... 'Parent',h17,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[0.498397435897436 1.04304635761589 1.00005459937205],... 'VerticalAlignment','bottom',... 'HandleVisibility','off'); h19 = get(h17,'xlabel'); set(h19,... 'Parent',h17,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[0.498397435897436 -0.155629139072848 1.00005459937205],... 'VerticalAlignment','cap',... 'HandleVisibility','off'); h20 = get(h17,'ylabel'); set(h20,... 'Parent',h17,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[-0.0753205128205128 0.493377483443709 1.00005459937205],... 'Rotation',90,... 'VerticalAlignment','bottom',... 'HandleVisibility','off'); h21 = get(h17,'zlabel'); set(h21,... 'Parent',h17,... 'Color',[0 0 0],... 'HorizontalAlignment','right',... 'Position',[-0.184294871794872 2.98344370860927 1.00005459937205],... 'HandleVisibility','off',... 'Visible','off'); h22 = axes(... 'Parent',h1,... 'Units','characters',... 'CameraPosition',[0.5 0.5 9.16025403784439],... 'CameraPositionMode',get(0,'defaultaxesCameraPositionMode'),... 'Color',get(0,'defaultaxesColor'),... 'ColorOrder',get(0,'defaultaxesColorOrder'),... 'Position',[76.6 17.3846153846154 65 12.4615384615385],... 'XColor',get(0,'defaultaxesXColor'),... 'YColor',get(0,'defaultaxesYColor'),... 'ZColor',get(0,'defaultaxesZColor'),... 'Tag','sig_2_time'); h23 = get(h22,'title'); set(h23,... 'Parent',h22,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[0.498397435897436 1.04304635761589 1.00005459937205],... 'VerticalAlignment','bottom',... 'HandleVisibility','off'); h24 = get(h22,'xlabel'); set(h24,... 'Parent',h22,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[0.498397435897436 -0.155629139072848 1.00005459937205],... 'VerticalAlignment','cap',... 'HandleVisibility','off'); h25 = get(h22,'ylabel'); set(h25,... 'Parent',h22,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[-0.0753205128205128 0.493377483443709 1.00005459937205],... 'Rotation',90,... 'VerticalAlignment','bottom',... 'HandleVisibility','off'); h26 = get(h22,'zlabel'); set(h26,... 'Parent',h22,... 'Color',[0 0 0],... 'HorizontalAlignment','right',... 'Position',[-1.19391025641026 2.98344370860927 1.00005459937205],... 'HandleVisibility','off',... 'Visible','off'); h27 = axes(... 'Parent',h1,... 'Units','characters',... 'CameraPosition',[0.5 0.5 9.16025403784439],... 'CameraPositionMode',get(0,'defaultaxesCameraPositionMode'),... 'Color',get(0,'defaultaxesColor'),... 'ColorOrder',get(0,'defaultaxesColorOrder'),... 'Position',[142.6 17.3846153846154 65 12.4615384615385],... 'XColor',get(0,'defaultaxesXColor'),... 'YColor',get(0,'defaultaxesYColor'),... 'ZColor',get(0,'defaultaxesZColor'),... 'Tag','sig_3_time'); h28 = get(h27,'title'); set(h28,... 'Parent',h27,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[0.498397435897436 1.04304635761589 1.00005459937205],... 'VerticalAlignment','bottom',... 'HandleVisibility','off'); h29 = get(h27,'xlabel'); set(h29,... 'Parent',h27,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[0.498397435897436 -0.155629139072848 1.00005459937205],... 'VerticalAlignment','cap',... 'HandleVisibility','off'); h30 = get(h27,'ylabel'); set(h30,... 'Parent',h27,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[-0.0753205128205128 0.493377483443709 1.00005459937205],... 'Rotation',90,... 'VerticalAlignment','bottom',... 'HandleVisibility','off'); h31 = get(h27,'zlabel'); set(h31,... 'Parent',h27,... 'Color',[0 0 0],... 'HorizontalAlignment','right',... 'Position',[-2.20673076923077 2.98344370860927 1.00005459937205],... 'HandleVisibility','off',... 'Visible','off'); h32 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'ListboxTop',0,... 'Position',[97.1666666666667 0.666666666666667 70.5 7.33333333333333],... 'String',{ '' },... 'Style','frame',... 'Tag','frame1'); h33 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'CData',[],... 'FontSize',18,... 'FontWeight','bold',... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[0.833333333333333 1.58333333333333 76 2.41666666666667],... 'String','Cross Synthesis Explorer',... 'Style','text',... 'Tag','text4',... 'UserData',[]); h34 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[0.833333333333333 0.333333333333333 45.1666666666667 1.25],... 'String','by Bob L. Sturm and Dr. Jerry Gibson',... 'Style','text',... 'Tag','text6'); h35 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',12,... 'ListboxTop',0,... 'Position',[157.2 52.3076923076923 35.8 1.69230769230769],... 'String','Cross-Synthesis',... 'Style','text',... 'Tag','text7'); h36 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',12,... 'ListboxTop',0,... 'Position',[94 52.2307692307692 30 1.76923076923077],... 'String','Signal 2',... 'Style','text',... 'Tag','text8'); h37 = uimenu(... 'Parent',h1,... 'Callback','xsynthexpogui(''File_Callback'',gcbo,[],guidata(gcbo))',... 'Label','File',... 'Tag','File'); h38 = uimenu(... 'Parent',h37,... 'Callback','xsynthexpogui(''saveworkspace_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Save Workspace',... 'Tag','saveworkspace'); h39 = uimenu(... 'Parent',h37,... 'Callback','xsynthexpogui(''openworkspace_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Open Workspace',... 'Tag','openworkspace'); h40 = uimenu(... 'Parent',h37,... 'Callback','xsynthexpogui(''write_soundfile_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Write Soundfile',... 'Tag','write_soundfile'); h41 = uimenu(... 'Parent',h37,... 'Callback','xsynthexpogui(''print_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Print',... 'Tag','print'); h42 = uimenu(... 'Parent',h37,... 'Callback','xsynthexpogui(''close_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Close',... 'Separator','on',... 'Tag','close'); h43 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',12,... 'ListboxTop',0,... 'Position',[33.2 52.0769230769231 19.6 1.76923076923077],... 'String','Signal 1',... 'Style','text',... 'Tag','text9'); h44 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','xsynthexpogui(''dB_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[114.666666666667 1.5 7.16666666666667 1.5],... 'String','dB',... 'Style','checkbox',... 'Value',1,... 'Tag','dB'); h45 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','xsynthexpogui(''fftsize_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[145.833333333333 4.25 18.3333333333333 1.5],... 'String',{ '64'; '128'; '256'; '512'; '1024'; '2048'; '4096'; '8192'; '16384'; '32768' },... 'Style','popupmenu',... 'Value',4,... 'CreateFcn','xsynthexpogui(''fftsize_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','fftsize'); h46 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','xsynthexpogui(''window_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[123.5 4.25 18.3333333333333 1.5],... 'String',{ 'Hann'; 'Rectangle'; 'Triangle'; 'Hamming'; 'Kaiser'; 'Bartlett'; 'Blackman-Harris'; 'Gaussian' },... 'Style','popupmenu',... 'Value',1,... 'CreateFcn','xsynthexpogui(''window_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','window'); h47 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','xsynthexpogui(''colormap_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[100.833333333333 4.25 18.3333333333333 1.5],... 'String',{ 'Jet'; 'Bone'; 'HSV'; 'Gray'; 'Hot'; 'Cool'; 'Prism' },... 'Style','popupmenu',... 'Value',1,... 'CreateFcn','xsynthexpogui(''colormap_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','colormap'); h48 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','xsynthexpogui(''inverse_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[100.833333333333 1.5 12.6666666666667 1.5],... 'String','Inverse',... 'Style','checkbox',... 'Tag','inverse'); h49 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',12,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[123.5 5.91666666666667 15.3333333333333 1.5],... 'String','Window',... 'Style','text',... 'Tag','text10'); h50 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',12,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[146.333333333333 5.91666666666667 17.5 1.5],... 'String','FFT Size',... 'Style','text',... 'Tag','text11'); h51 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',12,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[100.833333333333 5.91666666666667 18.8333333333333 1.5],... 'String','Colormap',... 'Style','text',... 'Tag','text12'); h52 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','xsynthexpogui(''interpolate_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[123.5 1.5 15.3333333333333 1.5],... 'String','Interpolate',... 'Style','checkbox',... 'Tag','interpolate'); h53 = uimenu(... 'Parent',h1,... 'Callback','xsynthexpogui(''crosssynthesis_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Cross Synthesis',... 'Tag','crosssynthesis'); h54 = uimenu(... 'Parent',h53,... 'Callback','xsynthexpogui(''convolution_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Convolution',... 'Tag','convolution'); h55 = uimenu(... 'Parent',h53,... 'Callback','xsynthexpogui(''amplitudenvelope_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Amplitude Envelope',... 'Tag','amplitudenvelope'); h56 = uimenu(... 'Parent',h53,... 'Callback','xsynthexpogui(''lpc_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Linear Prediction Coding',... 'Tag','lpc'); h57 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','xsynthexpogui(''s1_play_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[10.6666666666667 11.4166666666667 12.3333333333333 1.5],... 'String','Play',... 'Tag','s1_play'); h58 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','xsynthexpogui(''s2_play_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[76.8 11.3846153846154 12.2 1.46153846153846],... 'String','Play',... 'Tag','s2_play'); h59 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','xsynthexpogui(''s3_play_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[142.6 13.0769230769231 12.2 1.46153846153846],... 'String','Play',... 'Tag','s3_play'); h60 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','xsynthexpogui(''text1_Callback'',gcbo,[],guidata(gcbo))',... 'Enable','inactive',... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Max',10,... 'Position',[24.6666666666667 8.75 41.6666666666667 6],... 'String','',... 'Style','edit',... 'CreateFcn','xsynthexpogui(''text1_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','text1'); h61 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','xsynthexpogui(''text2_Callback'',gcbo,[],guidata(gcbo))',... 'Enable','inactive',... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Max',10,... 'Position',[91.2 8.69230769230769 41.6 6],... 'String','',... 'Style','edit',... 'CreateFcn','xsynthexpogui(''text2_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','text2'); h62 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','xsynthexpogui(''text3_Callback'',gcbo,[],guidata(gcbo))',... 'Enable','inactive',... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Max',10,... 'Position',[156.8 8.69230769230769 41.6 6],... 'String','',... 'Style','edit',... 'CreateFcn','xsynthexpogui(''text3_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','text3'); h63 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'BackgroundColor',[0.9 0.9 0.9],... 'Callback','xsynthexpogui(''freqzoom_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[0.666666666666667 30.75 2.16666666666667 20.75],... 'String',{ '' },... 'Style','slider',... 'Value',1,... 'CreateFcn','xsynthexpogui(''freqzoom_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','freqzoom'); h64 = uimenu(... 'Parent',h1,... 'Callback','xsynthexpogui(''help_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Help',... 'Tag','help'); h65 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','xsynthexpogui(''load_signal_1_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[10.6666666666667 13.25 12.3333333333333 1.5],... 'String','Load',... 'Tag','load_signal_1'); h66 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','xsynthexpogui(''load_signal_2_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[76.8 13.2307692307692 12.2 1.46153846153846],... 'String','Load',... 'Tag','load_signal_2'); h67 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','xsynthexpogui(''zoomreset_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[141.5 1.5 13 1.5],... 'String','Zoom Reset',... 'Tag','zoomreset'); hsingleton = h1; % --- 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 = [getfield(gui_State, gui_StateFields{i}), '.m']; end end numargin = length(varargin); if numargin == 0 % XSYNTHEXPOGUI % create the GUI gui_Create = 1; elseif numargin > 3 & ischar(varargin{1}) & ishandle(varargin{2}) % XSYNTHEXPOGUI('CALLBACK',hObject,eventData,handles,...) gui_Create = 0; else % XSYNTHEXPOGUI(...) % 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); 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 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) 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