⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 demo_detector.m

📁 用matlab的gui编写的DTMF双音多频信号生成与检测的演示程序
💻 M
字号:
function varargout = demo_detector(varargin)%DEMO_DETECTOR M-file for demo_detector.fig%      DEMO_DETECTOR, by itself, creates a new DEMO_DETECTOR or raises the existing%      singleton*.%%      H = DEMO_DETECTOR returns the handle to a new DEMO_DETECTOR or the handle to%      the existing singleton*.%%      DEMO_DETECTOR('Property','Value',...) creates a new DEMO_DETECTOR using the%      given property value pairs. Unrecognized properties are passed via%      varargin to demo_detector_OpeningFcn.  This calling syntax produces a%      warning when there is an existing singleton*.%%      DEMO_DETECTOR('CALLBACK') and DEMO_DETECTOR('CALLBACK',hObject,...) call the%      local function named CALLBACK in DEMO_DETECTOR.M with the given input%      arguments.%%      *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 demo_detector% Last Modified by GUIDE v2.5 27-Nov-2008 10:57:29% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name',       mfilename, ...                   'gui_Singleton',  gui_Singleton, ...                   'gui_OpeningFcn', @demo_detector_OpeningFcn, ...                   'gui_OutputFcn',  @demo_detector_OutputFcn, ...                   'gui_LayoutFcn',  [], ...                   'gui_Callback',   []);if nargin && ischar(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 demo_detector is made visible.function demo_detector_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   unrecognized PropertyName/PropertyValue pairs from the%            command line (see VARARGIN)% Choose default command line output for demo_detectorhandles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes demo_detector wait for user response (see UIRESUME)% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.function varargout = demo_detector_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 structurevarargout{1} = handles.output;% --------------------------------------------------------------------function FileMenu_Callback(hObject, eventdata, handles)% hObject    handle to FileMenu (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% --------------------------------------------------------------------function OpenMenuItem_Callback(hObject, eventdata, handles)% hObject    handle to OpenMenuItem (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)file = uigetfile('*.fig');if ~isequal(file, 0)    open(file);end% --------------------------------------------------------------------function PrintMenuItem_Callback(hObject, eventdata, handles)% hObject    handle to PrintMenuItem (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)printdlg(handles.figure1)% --------------------------------------------------------------------function CloseMenuItem_Callback(hObject, eventdata, handles)% hObject    handle to CloseMenuItem (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)selection = questdlg(['Close ' get(handles.figure1,'Name') '?'],...                     ['Close ' get(handles.figure1,'Name') '...'],...                     'Yes','No','Yes');if strcmp(selection,'No')    return;enddelete(handles.figure1)% --- Executes on button press in pushbutton1.function pushbutton1_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton1 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)[HT,T]=dtmf_1;[str1,g_low,L,g_high,H]=dtmf_detector1;set(handles.text2,'string',str1); axes(handles.axes3);cla;plot(T,HT);axes(handles.axes1);cla;stem(L,g_low);axes(handles.axes2);cla;stem(H,g_high);% --- Executes on button press in pushbutton2.function pushbutton2_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton2 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)[HT,T]=dtmf_2;[str2,g_low,L,g_high,H]=dtmf_detector2;set(handles.text2,'string',str2); axes(handles.axes3);cla;plot(T,HT);axes(handles.axes1);cla;stem(L,g_low);axes(handles.axes2);cla;stem(H,g_high);% --- Executes on button press in pushbutton3.function pushbutton3_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton3 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)[HT,T]=dtmf_3;[str3,g_low,L,g_high,H]=dtmf_detector3;set(handles.text2,'string',str3); axes(handles.axes3);cla;plot(T,HT);axes(handles.axes1);cla;stem(L,g_low);axes(handles.axes2);cla;stem(H,g_high);% --- Executes on button press in pushbutton4.function pushbutton4_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton4 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)[HT,T]=dtmf_A;[strA,g_low,L,g_high,H]=dtmf_detectorA;set(handles.text2,'string',strA); axes(handles.axes3);cla;plot(T,HT);axes(handles.axes1);cla;stem(L,g_low);axes(handles.axes2);cla;stem(H,g_high);% --- Executes on button press in pushbutton5.function pushbutton5_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton5 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)[HT,T]=dtmf_4;[str4,g_low,L,g_high,H]=dtmf_detector4;set(handles.text2,'string',str4); axes(handles.axes3);cla;plot(T,HT);axes(handles.axes1);cla;stem(L,g_low);axes(handles.axes2);cla;stem(H,g_high);% --- Executes on button press in pushbutton6.function pushbutton6_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton6 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)[HT,T]=dtmf_5;[str5,g_low,L,g_high,H]=dtmf_detector5;set(handles.text2,'string',str5); axes(handles.axes3);cla;plot(T,HT);axes(handles.axes1);cla;stem(L,g_low);axes(handles.axes2);cla;stem(H,g_high);% --- Executes on button press in pushbutton7.function pushbutton7_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton7 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)[HT,T]=dtmf_6;[str6,g_low,L,g_high,H]=dtmf_detector6;set(handles.text2,'string',str6); axes(handles.axes3);cla;plot(T,HT);axes(handles.axes1);cla;stem(L,g_low);axes(handles.axes2);cla;stem(H,g_high);% --- Executes on button press in pushbutton8.function pushbutton8_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton8 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)[HT,T]=dtmf_B;[strB,g_low,L,g_high,H]=dtmf_detectorB;set(handles.text2,'string',strB); axes(handles.axes3);cla;plot(T,HT);axes(handles.axes1);cla;stem(L,g_low);axes(handles.axes2);cla;stem(H,g_high);% --- Executes on button press in pushbutton9.function pushbutton9_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton9 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)[HT,T]=dtmf_7;[str7,g_low,L,g_high,H]=dtmf_detector7;set(handles.text2,'string',str7); axes(handles.axes3);cla;plot(T,HT);axes(handles.axes1);cla;stem(L,g_low);axes(handles.axes2);cla;stem(H,g_high);% --- Executes on button press in pushbutton10.function pushbutton10_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton10 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)[HT,T]=dtmf_8;[str8,g_low,L,g_high,H]=dtmf_detector8;set(handles.text2,'string',str8);axes(handles.axes3);cla;plot(T,HT);axes(handles.axes1);cla;stem(L,g_low);axes(handles.axes2);cla;stem(H,g_high);% --- Executes on button press in pushbutton11.function pushbutton11_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton11 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)[HT,T]=dtmf_9;[str9,g_low,L,g_high,H]=dtmf_detector9;set(handles.text2,'string',str9); axes(handles.axes3);cla;plot(T,HT);axes(handles.axes1);cla;stem(L,g_low);axes(handles.axes2);cla;stem(H,g_high);% --- Executes on button press in pushbutton12.function pushbutton12_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton12 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)[HT,T]=dtmf_C;[strC,g_low,L,g_high,H]=dtmf_detectorC;set(handles.text2,'string',strC); axes(handles.axes3);cla;plot(T,HT);axes(handles.axes1);cla;stem(L,g_low);axes(handles.axes2);cla;stem(H,g_high);% --- Executes on button press in pushbutton13.function pushbutton13_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton13 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)[HT,T]=dtmf_star;[strs,g_low,L,g_high,H]=dtmf_detector_star;set(handles.text2,'string',strs); axes(handles.axes3);cla;plot(T,HT);axes(handles.axes1);cla;stem(L,g_low);axes(handles.axes2);cla;stem(H,g_high);% --- Executes on button press in pushbutton14.function pushbutton14_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton14 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)[HT,T]=dtmf_0;[str0,g_low,L,g_high,H]=dtmf_detector0;set(handles.text2,'string',str0); axes(handles.axes3);cla;plot(T,HT);axes(handles.axes1);cla;stem(L,g_low);axes(handles.axes2);cla;stem(H,g_high);% --- Executes on button press in pushbutton15.function pushbutton15_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton15 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)[HT,T]=dtmf_number;[strn,g_low,L,g_high,H]=dtmf_detector_number;set(handles.text2,'string',strn); axes(handles.axes3);cla;plot(T,HT);axes(handles.axes1);cla;stem(L,g_low);axes(handles.axes2);cla;stem(H,g_high);% --- Executes on button press in pushbutton16.function pushbutton16_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton16 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)[HT,T]=dtmf_D;[strD,g_low,L,g_high,H]=dtmf_detectorD;set(handles.text2,'string',strD); axes(handles.axes3);cla;plot(T,HT);axes(handles.axes1);cla;stem(L,g_low);axes(handles.axes2);cla;stem(H,g_high);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -