www.gusucode.com > 声音的处理有:LPC,FFT,共振峰,频谱源码程序 > siganlandsystemusingMatlab/SSUM/xsynthesis/xsynthexpo.m
function varargout = xsynthexpo(varargin) % XSYNTHEXPO M-file for xsynthexpo.fig % XSYNTHEXPO, by itself, creates a new XSYNTHEXPO or raises the existing % singleton*. % % H = XSYNTHEXPO returns the handle to a new XSYNTHEXPO or the handle to % the existing singleton*. % % XSYNTHEXPO('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in XSYNTHEXPO.M with the given input arguments. % % XSYNTHEXPO('Property','Value',...) creates a new XSYNTHEXPO or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before xsynthexpo_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to xsynthexpo_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 xsynthexpo % Last Modified by GUIDE v2.5 25-Mar-2004 20:47:47 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @xsynthexpo_OpeningFcn, ... 'gui_OutputFcn', @xsynthexpo_OutputFcn, ... 'gui_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 xsynthexpo is made visible. function xsynthexpo_OpeningFcn(hObject, eventdata, handles, varargin) % Choose default command line output for xsynthexpo 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 = xsynthexpo_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';