www.gusucode.com > 声音的处理有:LPC,FFT,共振峰,频谱源码程序 > siganlandsystemusingMatlab/SSUM/convolution/convexpo.m

    function varargout = convexpo(varargin)
% CONVEXPO M-file for convexpo.fig
%      CONVEXPO, by itself, creates a new CONVEXPO or raises the existing
%      singleton*.
%
%      H = CONVEXPO returns the handle to a new CONVEXPO or the handle to
%      the existing singleton*.
%
%      CONVEXPO('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in CONVEXPO.M with the given input arguments.
%
%      CONVEXPO('Property','Value',...) creates a new CONVEXPO or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before convexpo_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to convexpo_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 convexpo

% Last Modified by GUIDE v2.5 19-Mar-2004 13:01:04

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @convexpo_OpeningFcn, ...
                   'gui_OutputFcn',  @convexpo_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 convexpo is made visible.
function convexpo_OpeningFcn(hObject, eventdata, handles, varargin)
	handles.output = hObject;
	set(gcf,'UserData',handles);
	guidata(hObject, handles);
	convexpofn;

	if nargin > 3
		datastruct = varargin{1};
		convexpofn('readinput',datastruct);
	end


% --- Outputs from this function are returned to the command line.
function varargout = convexpo_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;


% --- Executes on button press in stepback.
function stepback_Callback(hObject, eventdata, handles)
	convexpofn('stepback');

% --- Executes on button press in stepforw.
function stepforw_Callback(hObject, eventdata, handles)
	convexpofn('stepforw');

% --- Executes during object creation, after setting all properties.
function width1_CreateFcn(hObject, eventdata, handles)
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function width1_Callback(hObject, eventdata, handles)
	convexpofn('width1');


% --- Executes during object creation, after setting all properties.
function width2_CreateFcn(hObject, eventdata, handles)
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function width2_Callback(hObject, eventdata, handles)
	convexpofn('width2');


% --- Executes during object creation, after setting all properties.
function length1_CreateFcn(hObject, eventdata, handles)
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function length1_Callback(hObject, eventdata, handles)
	convexpofn('length1');


% --- Executes during object creation, after setting all properties.
function length2_CreateFcn(hObject, eventdata, handles)
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


function length2_Callback(hObject, eventdata, handles)
	convexpofn('length2');


% --- Executes on button press in play.
function play_Callback(hObject, eventdata, handles)
	convexpofn('play');


% --- Executes on button press in reset.
function reset_Callback(hObject, eventdata, handles)
	convexpofn('reset');


% --- Executes during object creation, after setting all properties.
function pulse1_type_CreateFcn(hObject, eventdata, handles)
% hObject    handle to pulse1_type (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


% --- Executes on selection change in pulse1_type.
function pulse1_type_Callback(hObject, eventdata, handles)
	convexpofn('pulse1');


% --- Executes during object creation, after setting all properties.
function pulse2_type_CreateFcn(hObject, eventdata, handles)
% hObject    handle to pulse2_type (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


% --- Executes on selection change in pulse2_type.
function pulse2_type_Callback(hObject, eventdata, handles)
	convexpofn('pulse2');
	contents = get(hObject,'String');
	switch contents{get(hObject,'Value')}
		case 'custom'
			%set(handles.width2,'Enable','inactive');
		otherwise
			set(handles.width2,'Enable','on');
	end


% --- Executes on button press in showshape.
function showshape_Callback(hObject, eventdata, handles)
    convexpofn('showshape');


% --- Executes on button press in grid.
function grid_Callback(hObject, eventdata, handles)
    convexpofn('grid');


% --- Executes during object creation, after setting all properties.
function edit5_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit5 (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 edit5_Callback(hObject, eventdata, handles)
% hObject    handle to edit5 (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 edit5 as text
%        str2double(get(hObject,'String')) returns contents of edit5 as a double


% --- Executes on button press in cyclic.
function cyclic_Callback(hObject, eventdata, handles)
	convexpofn 'cyclic';


% --------------------------------------------------------------------
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)
    convexpofn 'help';