大连理工大学实验报告学院(系):电信专业:电子信息工程班级:电子1204姓名:梁宇学号:201281001组:___实验时间:实验室:实验台:指导教师签字:成绩:实验二、电话拨号音的合成与识别一、实验题目和代码实现对电话通信系统中拨号音合成与识别的仿真实现。系统界面设计:源程序:functionvarargout=sy2(varargin)%SY2MATLABcodeforsy2.fig%SY2,byitself,createsanewSY2orraisestheexisting%singleton*.%%H=SY2returnsthehandletoanewSY2orthehandleto%theexistingsingleton*.%%SY2('CALLBACK',hObject,eventData,handles,...)callsthelocal%functionnamedCALLBACKinSY2.Mwiththegiveninputarguments.%%SY2('Property','Value',...)createsanewSY2orraisesthe%existingsingleton*.Startingfromtheleft,propertyvaluepairsare%appliedtotheGUIbeforesy2_OpeningFcngetscalled.An%unrecognizedpropertynameorinvalidvaluemakespropertyapplication%stop.Allinputsarepassedtosy2_OpeningFcnviavarargin.%%*SeeGUIOptionsonGUIDE'sToolsmenu.ChooseGUIallowsonlyone%instancetorun(singleton).%%Seealso:GUIDE,GUIDATA,GUIHANDLES%Edittheabovetexttomodifytheresponsetohelpsy2%LastModifiedbyGUIDEv2.503-Jun-201523:06:41%Begininitializationcode-DONOTEDITgui_Singleton=1;gui_State=struct('gui_Name',mfilename,...'gui_Singleton',gui_Singleton,...'gui_OpeningFcn',@sy2_OpeningFcn,...'gui_OutputFcn',@sy2_OutputFcn,...'gui_LayoutFcn',[],...'gui_Callback',[]);ifnargin&&ischar(varargin{1})gui_State.gui_Callback=str2func(varargin{1});endifnargout[varargout{1:nargout}]=gui_mainfcn(gui_State,varargin{:});elsegui_mainfcn(gui_State,varargin{:});end%Endinitializationcode-DONOTEDIT%---Executesjustbeforesy2ismadevisible.functionsy2_OpeningFcn(hObject,eventdata,handles,varargin)%Thisfunctionhasnooutputargs,seeOutputFcn.%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%varargincommandlineargumentstosy2(seeVARARGIN)%Choosedefaultcommandlineoutputforsy2handles.output=hObject;handles.fs=8192;handles.DTMFsum=820;handles.DTMFnum=410;handles.NUM=[];handles.numshow2=[];%Updatehandlesstructureguidata(hObject,handles);%UIWAITmakessy2waitforuserresponse(seeUIRESUME)%uiwait(handles.figure1);%---Outputsfromthisfunctionarereturnedtothecommandline.functionvarargout=sy2_OutputFcn(hObject,eventdata,handles)%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%Getdefaultcommandlineoutputfromhandlesstructurevarargout{1}=handles.output;%---Executesonbuttonpressinnum1.functionnum1_Callback(hObject,eventdata,handles)%hObjecthandletonum1(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)n1=strcat(get(handles.numshow,'string'),'1')%»ñÈ¡Êý×ÖºÅÂëset(handles.numshow,'string',n1);%ÏÔʾºÅÂën=[1:handles.DTMFnum];d1=sin(2*pi*697/handles.fs*n)+sin(2*pi*1209/handles.fs*n);%¶ÔÓ¦ÐÐÁÐƵÂÊspace=zeros(1,handles.DTMFnum);%410¸ö0Ä£Äâ¾²ÒôÐźÅtemp=[d1,space];handles.NUM=[handles.NUM,temp];%´æ´¢Á¬ÐøµÄ²¦ºÅÒôÐźÅguidata(hObject,handles);audioplayer(d1,8192);%---Executesonbuttonpressinnum2.functionnum2_Callback(hObject,eventdata,handles)%hObjecthandletonum2(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)n2=strcat(get(handles.numshow,'string'),'2')%»ñÈ¡Êý×ÖºÅÂëset(handles.numshow,'string',n2);%ÏÔʾºÅÂën=[1:handles.DTMFnum];d2=sin(2*pi*697/handles.fs*n)+sin(2*pi*1336/handles.fs*n);%¶ÔÓ¦ÐÐÁÐƵÂÊspace=zeros(1,handles.DTMFnum);%410¸ö0Ä£Äâ¾²ÒôÐźÅtemp=[d2,space];handles.NUM=[handles.NUM,temp];%´æ´¢Á¬ÐøµÄ²¦ºÅÒôÐźÅguidata(hObject,handles);audioplayer(d2,8192);%---Executesonbuttonpressinnum3.functionnum3_Callback(hObject,eventdata,handles)%hObjecthandletonum3(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)n3=strcat(get(handles.numshow,'string'),'3')%»ñÈ¡Êý×ÖºÅÂëset(handles.numshow,'string',n3);%ÏÔʾºÅÂën=[1:handles.DTMFnum];d3=sin(2*pi*697/handles.fs*n)+sin(2*pi*1477/handles.fs*n);%¶ÔÓ¦ÐÐÁÐƵÂÊspace=zeros(1,handles.DTMFnum);%410¸ö0Ä£Äâ¾²ÒôÐźÅtemp=[d3,space];handles.NUM=[handles.NUM,temp];%´æ´¢Á¬ÐøµÄ²¦ºÅÒôÐźÅguidata(hObject,handles);audioplayer(d3,8192);%---Executesonbuttonpressinnum4.functionnum4_Callback(hObject,eventdata,handles)%hObjecthandletonum4(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)n4=strcat(get(handles.numshow,'string'),'4')%»ñÈ¡Êý×ÖºÅÂëset(handles.numshow,'string',n4);%ÏÔʾºÅÂën=[1:handles.DTMFnum];d4=sin(2*pi*770/handles.fs*n)+sin(2*pi*1209/handles.fs*n);%¶ÔÓ¦ÐÐÁÐƵÂÊspace=zeros(1,handles.DTMFnum);%410¸ö0Ä£Äâ¾²ÒôÐźÅtemp=[d4,space];handles.NUM=[handles.NUM,temp];%´æ´¢Á¬ÐøµÄ²¦ºÅÒôÐźÅguidata(hObject,handles);audioplayer(d4,8192);%---Executesonbuttonpressinnum5.functionnum5_Callback(hObject,eventdata,handles)%hObjecthandletonum5(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)n5=strcat(get(handles.numshow,'string'),'5')%»ñÈ¡Êý×ÖºÅÂëset(handles.numshow,'string',n5);%ÏÔʾºÅÂën=[1:handles.DTMFnum];d5=sin(2*pi*770/handles.fs*n)+sin(2*pi*1336/handles.fs