gusucode.com > 声音的处理有:LPC,FFT,共振峰,频谱源码程序 > siganlandsystemusingMatlab/SSUM/modulation/modexpo.m
function varargout = modexpo(varargin) % MODEXPO M-file for modexpo.fig % MODEXPO, by itself, creates a new MODEXPO or raises the existing % singleton*. % % H = MODEXPO returns the handle to a new MODEXPO or the handle to % the existing singleton*. % % MODEXPO('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in MODEXPO.M with the given input arguments. % % MODEXPO('Property','Value',...) creates a new MODEXPO or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before modexpo_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to modexpo_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 modexpo % Last Modified by GUIDE v2.5 24-Mar-2004 12:39:17 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @modexpo_OpeningFcn, ... 'gui_OutputFcn', @modexpo_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 modexpo is made visible. function modexpo_OpeningFcn(hObject, eventdata, handles, varargin) handles.output = hObject; guidata(hObject, handles); set(gcf,'UserData',handles); modexpofn; % --- Outputs from this function are returned to the command line. function varargout = modexpo_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 File_Callback(hObject, eventdata, handles) % hObject handle to File (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % -------------------------------------------------------------------- function load_carsig_Callback(hObject, eventdata, handles) handles = get(gcf,'UserData'); handles.signum = 2; set(gcf,'UserData',handles); modexpofn 'loadsound'; % -------------------------------------------------------------------- function load_modsig_Callback(hObject, eventdata, handles) handles = get(gcf,'UserData'); handles.signum = 1; set(gcf,'UserData',handles); modexpofn 'loadsound'; % --- Executes on button press in dB. function dB_Callback(hObject, eventdata, handles) modexpofn '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) modexpofn 'fftsize'; % --- Executes on button press in zoomreset. function zoomreset_Callback(hObject, eventdata, handles) modexpofn 'zoomreset'; % --- 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) modexpofn '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) modexpofn 'colormap'; % --- Executes on button press in inverse. function inverse_Callback(hObject, eventdata, handles) modexpofn 'inverse'; % --- Executes on button press in interpolate. function interpolate_Callback(hObject, eventdata, handles) modexpofn 'interpolate'; % -------------------------------------------------------------------- function modulation_Callback(hObject, eventdata, handles) % -------------------------------------------------------------------- function amdsbsc_mod_Callback(hObject, eventdata, handles) modexpofn 'amdsbsc'; % -------------------------------------------------------------------- function amdsbtc_mod_Callback(hObject, eventdata, handles) modexpofn 'amdsbtc'; % --- 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); modexpofn '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); modexpofn '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); modexpofn 'play'; % -------------------------------------------------------------------- function openworkspace_Callback(hObject, eventdata, handles) modexpofn 'loadworkspace'; % -------------------------------------------------------------------- function saveworkspace_Callback(hObject, eventdata, handles) modexpofn 'saveworkspace'; % -------------------------------------------------------------------- function signal_Callback(hObject, eventdata, handles) % -------------------------------------------------------------------- function createmod_Callback(hObject, eventdata, handles) modexpofn 'createmod'; % --- Executes on button press in recalculate. function recalculate_Callback(hObject, eventdata, handles) function save_modulation_soundfile_Callback(hObject, eventdata, handles) modexpofn 'write_soundfile'; function save_modulated_soundfile_Callback(hObject, eventdata, handles) modexpofn 'write_modsoundfile'; % -------------------------------------------------------------------- function ssbsc_mod_Callback(hObject, eventdata, handles) % hObject handle to ssbtc_mod (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) modexpofn 'ssbsc'; % --- Executes during object creation, after setting all properties. function popupmenu5_CreateFcn(hObject, eventdata, handles) % hObject handle to popupmenu5 (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 popupmenu5. function popupmenu5_Callback(hObject, eventdata, handles) % hObject handle to popupmenu5 (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 popupmenu5 contents as cell array % contents{get(hObject,'Value')} returns selected item from popupmenu5 % --- Executes during object creation, after setting all properties. function timezoom1_CreateFcn(hObject, eventdata, handles) % hObject handle to timezoom1 (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 timezoom1_Callback(hObject, eventdata, handles) % hObject handle to timezoom1 (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 modexpofn 'sig1_axis'; % --- 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 modexpofn 'freqzoom'; % --- Executes during object creation, after setting all properties. function display_CreateFcn(hObject, eventdata, handles) % hObject handle to display (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 display. function display_Callback(hObject, eventdata, handles) % hObject handle to display (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 display contents as cell array % contents{get(hObject,'Value')} returns selected item from display modexpofn 'display'; % --- Executes during object creation, after setting all properties. function am_offset_CreateFcn(hObject, eventdata, handles) % hObject handle to display (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 display. function am_offset_Callback(hObject, eventdata, handles) % hObject handle to display (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 display contents as cell array % contents{get(hObject,'Value')} returns selected item from display % --- Executes during object creation, after setting all properties. function slider4_CreateFcn(hObject, eventdata, handles) % hObject handle to slider4 (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 slider4_Callback(hObject, eventdata, handles) % hObject handle to slider4 (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 % --- Executes during object creation, after setting all properties. function slider5_CreateFcn(hObject, eventdata, handles) % hObject handle to slider5 (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 slider5_Callback(hObject, eventdata, handles) % hObject handle to slider5 (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 % --- 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 on button press in create_modsig. function create_modsig_Callback(hObject, eventdata, handles) % hObject handle to create_modsig (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) modexpofn 'create_modsig'; % --- Executes on button press in create_carsig. function create_carsig_Callback(hObject, eventdata, handles) % hObject handle to create_carsig (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) modexpofn 'create_carsig'; % -------------------------------------------------------------------- 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 fourierexpo_Callback(hObject, eventdata, handles) % hObject handle to fourierexpo (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) modexpofn 'fourier'; % --- 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 % -------------------------------------------------------------------- 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) modexpofn 'close'; % -------------------------------------------------------------------- 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) modexpofn 'print'; % -------------------------------------------------------------------- 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) modexpofn 'help';