📄 compandexpo.m
字号:
function varargout = compandexpo(varargin)% COMPANDEXPO M-file for compandexpo.fig% COMPANDEXPO, by itself, creates a new COMPANDEXPO or raises the existing% singleton*.%% H = COMPANDEXPO returns the handle to a new COMPANDEXPO or the handle to% the existing singleton*.%% COMPANDEXPO('CALLBACK',hObject,eventData,handles,...) calls the local% function named CALLBACK in COMPANDEXPO.M with the given input arguments.%% COMPANDEXPO('Property','Value',...) creates a new COMPANDEXPO or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before compandexpo_OpeningFunction gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to compandexpo_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 compandexpo% Last Modified by GUIDE v2.5 20-Nov-2005 17:22:11% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @compandexpo_OpeningFcn, ... 'gui_OutputFcn', @compandexpo_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []);if nargin & isstr(varargin{1}) gui_State.gui_Callback = str2func(varargin{1});endif 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 compandexpo is made visible.function compandexpo_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 compandexpo (see VARARGIN)% Choose default command line output for compandexpo handles.output = hObject; guidata(hObject, handles); set(gcf,'UserData',handles); compandexpofn; if (nargin > 3) datastruct = varargin{1}; compandexpofn('readinput',datastruct); end% --- Outputs from this function are returned to the command line.function varargout = compandexpo_OutputFcn(hObject, eventdata, handles) varargout{1} = handles.output;% --------------------------------------------------------------------function FileMenu_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function PrintMenuItem_Callback(hObject, eventdata, handles) compandexpofn 'print';% --------------------------------------------------------------------function CloseMenuItem_Callback(hObject, eventdata, handles) compandexpofn 'close';% --------------------------------------------------------------------function apply_Callback(hObject, eventdata, handles)% hObject handle to apply (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) compandexpofn 'apply';% --------------------------------------------------------------------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) compandexpofn 'help';% --- Executes when compandexpo_fig window is resized.function compandexpo_fig_ResizeFcn(hObject, eventdata, handles)% hObject handle to compandexpo_fig (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) compandexpofn 'resize';% --- Executes on selection change in pdfmenu.function pdfmenu_Callback(hObject, eventdata, handles)% hObject handle to pdfmenu (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 pdfmenu contents as cell array% contents{get(hObject,'Value')} returns selected item from pdfmenu compandexpofn 'pdfupdate';% --- Executes during object creation, after setting all properties.function pdfmenu_CreateFcn(hObject, eventdata, handles)% hObject handle to pdfmenu (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');endfunction levels_Callback(hObject, eventdata, handles)% hObject handle to levels (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 levels as text% str2double(get(hObject,'String')) returns contents of levels as a double test = floor(abs(str2num(get(hObject,'String')))); if test > 0 set(hObject,'String',num2str(test)); else set(hObject,'String',num2str(1)); end compandexpofn 'sqnrupdate';% --- Executes during object creation, after setting all properties.function levels_CreateFcn(hObject, eventdata, handles)% hObject handle to levels (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 play_orig.function play_orig_Callback(hObject, eventdata, handles)% hObject handle to play_orig (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) compandexpofn 'play_orig';% --- Executes on button press in play_quant.function play_quant_Callback(hObject, eventdata, handles)% hObject handle to play_quant (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) compandexpofn 'play_quant';function maxx_Callback(hObject, eventdata, handles)% hObject handle to maxx (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 maxx as text% str2double(get(hObject,'String')) returns contents of maxx as a double test = abs(str2num(get(hObject,'String'))); set(hObject,'String',num2str(test)); compandexpofn 'sqnrupdate';% --- Executes during object creation, after setting all properties.function maxx_CreateFcn(hObject, eventdata, handles)% hObject handle to maxx (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');endfunction mu_Callback(hObject, eventdata, handles)% hObject handle to mu (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 mu as text% str2double(get(hObject,'String')) returns contents of mu as a double test = abs(str2num(get(hObject,'String'))); set(hObject,'String',num2str(test)); compandexpofn 'sqnrupdate';% --- Executes during object creation, after setting all properties.function mu_CreateFcn(hObject, eventdata, handles)% hObject handle to mu (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 holdon.function holdon_Callback(hObject, eventdata, handles)% hObject handle to holdon (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 holdon% --- Executes on selection change in compmenu.function compmenu_Callback(hObject, eventdata, handles)% hObject handle to compmenu (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 compmenu contents as cell array% contents{get(hObject,'Value')} returns selected item from compmenu contents = get(hObject,'String'); switch lower(contents{get(hObject,'Value')}) case 'mu-law' set(handles.compstring,'String','mu'); case 'a-law' set(handles.compstring,'String','A'); end compandexpofn 'sqnrupdate';% --- Executes during object creation, after setting all properties.function compmenu_CreateFcn(hObject, eventdata, handles)% hObject handle to compmenu (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 selection change in quantmenu.function quantmenu_Callback(hObject, eventdata, handles)% hObject handle to quantmenu (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 quantmenu contents as cell array% contents{get(hObject,'Value')} returns selected item from quantmenu compandexpofn 'sqnrupdate';% --- Executes during object creation, after setting all properties.function quantmenu_CreateFcn(hObject, eventdata, handles)% hObject handle to quantmenu (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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -