版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
課程設(shè)計(jì)的目的和任務(wù)“數(shù)字信號(hào)處理〞課程是信息和通信工程專業(yè)必修的專業(yè)技術(shù)根底課程。課程以信號(hào)與系統(tǒng)作為研究對(duì)象,研究對(duì)信號(hào)進(jìn)行各種處理和利用的技術(shù)。通過(guò)該課程的學(xué)習(xí),學(xué)生應(yīng)牢固掌握確定性信號(hào)和系統(tǒng)的分析方法、相關(guān)算法、系統(tǒng)實(shí)現(xiàn)等的相關(guān)知識(shí)的,借助于數(shù)字濾波器的設(shè)計(jì)及實(shí)現(xiàn),學(xué)生可掌握數(shù)字系統(tǒng)的分析以及設(shè)計(jì)方法。數(shù)字信號(hào)處理是理論性和工程性都很強(qiáng)的學(xué)科,本課程設(shè)計(jì)的目的就是使該課程的理論與工程應(yīng)用的緊密結(jié)合,使學(xué)生深入理解信號(hào)處理的內(nèi)涵和實(shí)質(zhì)。本課程設(shè)計(jì)要求學(xué)生在理解信號(hào)處理的數(shù)學(xué)原理的根底上,應(yīng)用計(jì)算機(jī)編程手段,實(shí)現(xiàn)一種信號(hào)分析或處理的設(shè)計(jì),到達(dá)對(duì)所學(xué)內(nèi)容融會(huì)貫穿,綜合各局部知識(shí),按照題目要求獨(dú)立設(shè)計(jì)完成。課程設(shè)計(jì)的題目和要求1.課程設(shè)計(jì)題目:DTMF信號(hào)的產(chǎn)生與解碼DTMF編解碼廣泛應(yīng)用于數(shù)字撥號(hào),簡(jiǎn)單通信協(xié)議等領(lǐng)域。目前所有的和機(jī)按鍵都是采用DTMF信號(hào)進(jìn)行編碼和傳輸?shù)?,該方案?shí)際是利用模擬信號(hào)對(duì)數(shù)字符號(hào)進(jìn)行編碼。該編碼方案共使用8個(gè)模擬頻率對(duì)16個(gè)符號(hào)進(jìn)行編碼,這16個(gè)頻率分為2個(gè)群:高音群和低音群。所以稱為雙音多頻(Dual-ToneMultiple-Frequency)編碼,其編碼方案如圖1。由圖可知每個(gè)符號(hào)由一個(gè)高音頻率和一個(gè)低音頻率唯一確定。圖1DTMF信號(hào)編碼方案對(duì)于該信號(hào)的產(chǎn)生,我們可以利用數(shù)字振蕩器來(lái)完成。而對(duì)這些信號(hào)的檢測(cè),那么可以利用DFT來(lái)完成。要注意的是,這里只需要計(jì)算16個(gè)頻點(diǎn)的FFT輸出,因此課本上介紹基2或基4算法并不是最優(yōu)的,這時(shí)我們需要采用Goerzel算法完成所需的DFT。當(dāng)然我們也可以用16個(gè)窄帶帶通濾波器完成,窄帶帶通濾波器的中心頻率就是上述各頻率。對(duì)窄帶濾波器輸出信號(hào)的輸出做判決就可以得到解碼的結(jié)果。編制程序生成并顯示各符號(hào)的時(shí)域信號(hào)和對(duì)應(yīng)的幅頻曲線。編程模擬撥號(hào)過(guò)程:輸入號(hào)碼,生成各號(hào)碼的時(shí)域信號(hào),給時(shí)域信號(hào)加噪聲,編程對(duì)含噪聲的撥號(hào)信號(hào)進(jìn)行解碼。編制程序測(cè)試編解碼程序的正確性。要列出表格,統(tǒng)計(jì)撥出的符號(hào)的解碼成功率。獨(dú)立完成設(shè)計(jì),選擇自己熟悉的編程語(yǔ)言編寫程序,最好能給出圖形界面。設(shè)計(jì)過(guò)程與結(jié)果1.在MATLAB中建立一個(gè)GUI圖形界面,將本課程設(shè)計(jì)所要實(shí)現(xiàn)的功能的一些工具拖進(jìn)GUI界面,并根據(jù)需要修改各個(gè)工具的屬性,建立的初始界面如圖2所示。圖2GUI圖形設(shè)計(jì)的初始界面翻開jink.fig界面所對(duì)應(yīng)的源程序編輯窗口,其中MATLAB會(huì)自動(dòng)生成界面的初始化程序代碼以及1——D、“解碼檢測(cè)〞和“退出〞共18個(gè)按鈕各按鈕的函數(shù)名和參數(shù)功能解釋。在這里,我們需要對(duì)每個(gè)按鈕要實(shí)現(xiàn)的具體功能編寫程序,由于按鈕函數(shù)較多,且1——D數(shù)字按鈕的功能相似,故可以編寫函數(shù)供每個(gè)這樣的函數(shù)調(diào)用,從而防止程序的繁雜冗余。例如對(duì)于點(diǎn)擊數(shù)字鍵“1〞時(shí)要實(shí)現(xiàn)的功能的函數(shù)可以為如下代碼:set(handles.DecodeText,'string','');%清空解碼顯示文本框Signal=PressKeyDown(handles,'1');handles.DTMFSignal=Signal;handles.TelNumber=strcat(handles.TelNumber,'1');%Updatehandlesstructureguidata(hObject,handles);set(handles.CodeText,'string',handles.TelNumber);當(dāng)運(yùn)行程序后點(diǎn)擊數(shù)字鍵“1〞時(shí),pushbutton1_Callback函數(shù)會(huì)調(diào)用PressKeyDown函數(shù),從而完成發(fā)出相應(yīng)的聲音、在text1文本框中顯示出點(diǎn)擊的數(shù)字、在axes1和axes2畫出對(duì)應(yīng)的圖形等功能。點(diǎn)擊幾個(gè)數(shù)字或字母鍵后,在界面中運(yùn)行的結(jié)果如圖3所示。圖3撥號(hào)時(shí)界面的顯示結(jié)果在撥號(hào)后,要對(duì)所接收的撥號(hào)信號(hào)進(jìn)行解碼檢測(cè),檢測(cè)兩個(gè)正弦波的頻率分別是多少,以判斷所對(duì)應(yīng)的十進(jìn)制數(shù)字或字母符號(hào)。檢測(cè)方法有兩種,一是用一組濾波器提取所關(guān)心的頻率,根據(jù)兩個(gè)濾波器的輸出信號(hào)判斷相應(yīng)的數(shù)字或符號(hào),另一是用DFT〔FFT〕對(duì)雙音多頻信號(hào)進(jìn)行頻譜分析,由信號(hào)幅度譜判斷信號(hào)的兩個(gè)頻率,最后確定相應(yīng)的數(shù)字或符號(hào)。本設(shè)計(jì)所編寫的相應(yīng)的解碼局部程序代碼如下:functionpushbutton17_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton17(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)handles.DecodeTelNumber='';%清空解碼字符串變量,開始新一輪解碼。keys=['1','2','3','A';'4','5','6','B';'7','8','9','C';'*','0','#','D'];fori=1:length(handles.TelNumber)Signal=dtmf(handles.TelNumber(i));RowNumber=FindLowerFreq(Signal);ColumnNumber=FindHigherFreq(Signal);ResultKey=keys(RowNumber,ColumnNumber);handles.DecodeTelNumber=strcat(handles.DecodeTelNumber,ResultKey);set(handles.DecodeText,'string',handles.DecodeTelNumber);endhandles.TelNumber='';%解碼完成后,撥號(hào)變量清空,方便下一次撥號(hào)。點(diǎn)擊“解碼檢測(cè)〞按鈕,進(jìn)行解碼的運(yùn)行結(jié)果如圖4所示。圖4解碼后的結(jié)果由圖4可以看出,在解碼的文本框中顯示出正確的撥號(hào),表示解碼正確。點(diǎn)“退出〞鍵后界面關(guān)閉退出。課程設(shè)計(jì)總結(jié)經(jīng)過(guò)幾天的努力,我終于完成了基于MATLAB的DTMF信號(hào)的產(chǎn)生與解碼課程設(shè)計(jì),由于剛上完數(shù)字信號(hào)處理這門課程,對(duì)相關(guān)的知識(shí)還是比擬熟悉,但是對(duì)于數(shù)字信號(hào)處理的實(shí)質(zhì)的理解還是不夠深刻,因此剛開始不知如何下手,覺(jué)得困難比擬多,不過(guò)最后經(jīng)過(guò)屢次修改和整理,還是完成了。受到自己知識(shí)水平的限制,此次課程設(shè)計(jì)還有很多缺乏的地方。通過(guò)這次課程設(shè)計(jì),我發(fā)現(xiàn)自己以前關(guān)于數(shù)字信號(hào)處理這門課的看法太片面,課程設(shè)計(jì)不僅僅是對(duì)所學(xué)知識(shí)的一種檢驗(yàn),更是對(duì)自己能力的一種提高,這次課程設(shè)計(jì)使我明白前面所學(xué)的那點(diǎn)知識(shí)是非常欠缺的,要學(xué)的東西還很多。比方在使用MATLAB制作圖形界面上,以前上過(guò)這個(gè)課程,但沒(méi)有學(xué)其中GUI界面設(shè)計(jì)局部,這就要求我們?nèi)プ詫W(xué)。在這次課程設(shè)計(jì)中,我遇到過(guò)很多問(wèn)題,發(fā)現(xiàn)我所學(xué)的知識(shí)實(shí)在有限,好在同學(xué)之間可以相互討論,還可以充分利用網(wǎng)絡(luò)去查閱相關(guān)資料。在整理與修改的過(guò)程中,我學(xué)到了很多新的知識(shí),也培養(yǎng)了獨(dú)立思考和設(shè)計(jì)的能力,樹立了對(duì)知識(shí)應(yīng)用的信心,相信會(huì)對(duì)以后的學(xué)習(xí)工作都有很大的幫助,并且提高了自己的動(dòng)手實(shí)踐能力。在這次課程設(shè)計(jì)的過(guò)程中,我得到了許多人的幫助,感謝指導(dǎo)老師耐心的講解,也感謝在一起討論的同學(xué),從中我得到了很多好的建議和方法??傊?,本次課程設(shè)計(jì)的過(guò)程雖然曲折,但是收獲還是蠻大的,這不是對(duì)知識(shí)的終結(jié),而是我學(xué)習(xí)更多知識(shí)的一個(gè)平臺(tái)。參考文獻(xiàn)李正周,MATLAB數(shù)字信號(hào)處理與應(yīng)用,北京:清華大學(xué)出版社,2023徐明遠(yuǎn)、劉增力,MATLAB仿真在信號(hào)處理中的應(yīng)用,西安:電子科技大學(xué)出版社,2007李顯宏,MTALAB7.x界面設(shè)計(jì)與編譯技巧,北京:電子工業(yè)出版社,2006附錄源程序代碼:functionvarargout=jink(varargin)%JINK,byitself,createsanewJINKorraisestheexisting%singleton*.%%H=JINKreturnsthehandletoanewJINKorthehandleto%theexistingsingleton*.%%JINK('CALLBACK',hObject,eventData,handles,...)callsthelocal%functionnamedCALLBACKinJINK.Mwiththegiveninputarguments.%%JINK('Property','Value',...)createsanewJINKorraisesthe%existingsingleton*.Startingfromtheleft,propertyvaluepairsare%appliedtotheGUIbeforejink_OpeningFcngetscalled.An%unrecognizedpropertynameorinvalidvaluemakespropertyapplication%stop.Allinputsarepassedtojink_OpeningFcnviavarargin.%%*SeeGUIOptionsonGUIDE'sToolsmenu.Choose"GUIallowsonlyone%instancetorun(singleton)".%%Seealso:GUIDE,GUIDATA,GUIHANDLES%Edittheabovetexttomodifytheresponsetohelpjink%LastModifiedbyGUIDEv2.501-Jan-202313:20:27%Begininitializationcode-DONOTEDITgui_Singleton=1;gui_State=struct('gui_Name',mfilename,...'gui_Singleton',gui_Singleton,...'gui_OpeningFcn',@jink_OpeningFcn,...'gui_OutputFcn',@jink_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%---Executesjustbeforejinkismadevisible.functionjink_OpeningFcn(hObject,eventdata,handles,varargin)%Thisfunctionhasnooutputargs,seeOutputFcn.%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%varargincommandlineargumentstojink(seeVARARGIN)%Choosedefaultcommandlineoutputforjinkhandles.output=hObject;handles.DTMFSignal=[];handles.TelNumber='';handles.DecodeTelNumber='';%保存解碼字符串變量set(gcf,'CurrentAxes',handles.axes1);xlabel('單位:〔s〕');set(gcf,'CurrentAxes',handles.axes2);xlabel('單位:〔Hz〕');%Updatehandlesstructureguidata(hObject,handles);%UIWAITmakesjinkwaitforuserresponse(seeUIRESUME)%uiwait(handles.figure1);%---Outputsfromthisfunctionarereturnedtothecommandline.functionvarargout=jink_OutputFcn(hObject,eventdata,handles)%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%Getdefaultcommandlineoutputfromhandlesstructurevarargout{1}=handles.output;%---Executesonbuttonpressinpushbutton1.functionpushbutton1_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton1(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)set(handles.DecodeText,'string','');%清空解碼顯示文本框Signal=PressKeyDown(handles,'1');handles.DTMFSignal=Signal;handles.TelNumber=strcat(handles.TelNumber,'1');%Updatehandlesstructureguidata(hObject,handles);set(handles.CodeText,'string',handles.TelNumber);%---Executesonbuttonpressinpushbutton2.functionpushbutton2_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton2(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)set(handles.DecodeText,'string','');%清空解碼顯示文本框Signal=PressKeyDown(handles,'2');handles.DTMFSignal=Signal;handles.TelNumber=strcat(handles.TelNumber,'2');%Updatehandlesstructureguidata(hObject,handles);set(handles.CodeText,'string',handles.TelNumber);%---Executesonbuttonpressinpushbutton3.functionpushbutton3_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton3(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)set(handles.DecodeText,'string','');%清空解碼顯示文本框Signal=PressKeyDown(handles,'3');handles.DTMFSignal=Signal;handles.TelNumber=strcat(handles.TelNumber,'3');%Updatehandlesstructureguidata(hObject,handles);set(handles.CodeText,'string',handles.TelNumber);%---Executesonbuttonpressinpushbutton4.functionpushbutton4_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton4(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)set(handles.DecodeText,'string','');%清空解碼顯示文本框Signal=PressKeyDown(handles,'4');handles.DTMFSignal=Signal;handles.TelNumber=strcat(handles.TelNumber,'4');%Updatehandlesstructureguidata(hObject,handles);set(handles.CodeText,'string',handles.TelNumber);%---Executesonbuttonpressinpushbutton5.functionpushbutton5_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton5(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)set(handles.DecodeText,'string','');%清空解碼顯示文本框Signal=PressKeyDown(handles,'5');handles.DTMFSignal=Signal;handles.TelNumber=strcat(handles.TelNumber,'5');%Updatehandlesstructureguidata(hObject,handles);set(handles.CodeText,'string',handles.TelNumber);%---Executesonbuttonpressinpushbutton6.functionpushbutton6_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton6(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)set(handles.DecodeText,'string','');%清空解碼顯示文本框Signal=PressKeyDown(handles,'6');handles.DTMFSignal=Signal;handles.TelNumber=strcat(handles.TelNumber,'6');%Updatehandlesstructureguidata(hObject,handles);set(handles.CodeText,'string',handles.TelNumber);%---Executesonbuttonpressinpushbutton7.functionpushbutton7_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton7(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)set(handles.DecodeText,'string','');%清空解碼顯示文本框Signal=PressKeyDown(handles,'7');handles.DTMFSignal=Signal;handles.TelNumber=strcat(handles.TelNumber,'7');%Updatehandlesstructureguidata(hObject,handles);set(handles.CodeText,'string',handles.TelNumber);%---Executesonbuttonpressinpushbutton8.functionpushbutton8_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton8(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)set(handles.DecodeText,'string','');%清空解碼顯示文本框Signal=PressKeyDown(handles,'8');handles.DTMFSignal=Signal;handles.TelNumber=strcat(handles.TelNumber,'8');%Updatehandlesstructureguidata(hObject,handles);set(handles.CodeText,'string',handles.TelNumber);%---Executesonbuttonpressinpushbutton9.functionpushbutton9_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton9(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)set(handles.DecodeText,'string','');%清空解碼顯示文本框Signal=PressKeyDown(handles,'9');handles.DTMFSignal=Signal;handles.TelNumber=strcat(handles.TelNumber,'9');%Updatehandlesstructureguidata(hObject,handles);set(handles.CodeText,'string',handles.TelNumber);%---Executesonbuttonpressinpushbutton10.functionpushbutton10_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton10(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)set(handles.DecodeText,'string','');%清空解碼顯示文本框Signal=PressKeyDown(handles,'*');handles.DTMFSignal=Signal;handles.TelNumber=strcat(handles.TelNumber,'*');%Updatehandlesstructureguidata(hObject,handles);set(handles.CodeText,'string',handles.TelNumber);%---Executesonbuttonpressinpushbutton11.functionpushbutton11_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton11(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)set(handles.DecodeText,'string','');%清空解碼顯示文本框Signal=PressKeyDown(handles,'0');handles.DTMFSignal=Signal;handles.TelNumber=strcat(handles.TelNumber,'0');%Updatehandlesstructureguidata(hObject,handles);set(handles.CodeText,'string',handles.TelNumber);%---Executesonbuttonpressinpushbutton12.functionpushbutton12_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton12(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)set(handles.DecodeText,'string','');%清空解碼顯示文本框Signal=PressKeyDown(handles,'#');handles.DTMFSignal=Signal;handles.TelNumber=strcat(handles.TelNumber,'#');%Updatehandlesstructureguidata(hObject,handles);set(handles.CodeText,'string',handles.TelNumber);%---Executesonbuttonpressinpushbutton13.functionpushbutton13_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton13(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)set(handles.DecodeText,'string','');%清空解碼顯示文本框Signal=PressKeyDown(handles,'A');handles.DTMFSignal=Signal;handles.TelNumber=strcat(handles.TelNumber,'A');%Updatehandlesstructureguidata(hObject,handles);set(handles.CodeText,'string',handles.TelNumber);%---Executesonbuttonpressinpushbutton14.functionpushbutton14_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton14(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)set(handles.DecodeText,'string','');%清空解碼顯示文本框Signal=PressKeyDown(handles,'B');handles.DTMFSignal=Signal;handles.TelNumber=strcat(handles.TelNumber,'B');%Updatehandlesstructureguidata(hObject,handles);set(handles.CodeText,'string',handles.TelNumber);%---Executesonbuttonpressinpushbutton15.functionpushbutton15_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton15(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)set(handles.DecodeText,'string','');%清空解碼顯示文本框Signal=PressKeyDown(handles,'C');handles.DTMFSignal=Signal;handles.TelNumber=strcat(handles.TelNumber,'C');%Updatehandlesstructureguidata(hObject,handles);set(handles.CodeText,'string',handles.TelNumber);%---Executesonbuttonpressinpushbutton16.functionpushbutton16_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton16(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)set(handles.DecodeText,'string','');%清空解碼顯示文本框Signal=PressKeyDown(handles,'D');handles.DTMFSignal=Signal;handles.TelNumber=strcat(handles.TelNumber,'D');%Updatehandlesstructureguidata(hObject,handles);set(handles.CodeText,'string',handles.TelNumber);%---Executesonbuttonpressinpushbutton17.functionpushbutton17_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton17(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)handles.DecodeTelNumber='';%清空解碼字符串變量,開始新一輪解碼。keys=['1','2','3','A';'4','5','6','B';'7','8','9','C';'*','0','#','D'];fori=1:length(handles.TelNumber)Signal=dtmf(handles.TelNumber(i));RowNumber=FindLowerFreq(Signal);ColumnNumber=FindHigherFreq(Signal);ResultKey=keys(RowNumber,ColumnNumber);handles.DecodeTelNumber=strcat(handles.DecodeTelNumber,ResultKey);set(handles.DecodeText,'string',handles.DecodeTelNumber);endhandles.TelNumber='';%解碼完成后,撥號(hào)變量清空,方便下一次撥號(hào)。%Updatehandlesstructureguidata(hObject,handles);%RowNumber=FindLowerFreq(handles.DTMFSignal);%ColumnNumber=FindHigherFreq(handles.DTMFSignal);%ResultKey=keys(RowNumber,ColumnNumber);%set(handles.DecodeText,'string',char(ResultKey));functionSignal=PressKeyDown(handles,key)Signal=dtmf(key);sound(Signal,8000);%利用聲卡播放撥號(hào)音set(gcf,'CurrentAxes',handles.axes1);NSignal=length(Signal);t=1/8000:1/8000:NSignal/8000;plot(t,Signal);grid;%畫信號(hào)的時(shí)域波形xlabel('單位:〔s〕');Spectrum=fft(Signal);Spectrum=fftshift(Spectrum);%計(jì)算信號(hào)的頻譜N=length(Spectrum);nStep=(2*pi)/(N-1);w=-pi:nStep:pi;set(gcf,'CurrentAxes',handles.axes2);plot(w/(2*pi)*8000,abs(Spectrum));grid;%畫信號(hào)的頻譜圖axis([-2000,2000,0,200]);xlabel('單位:〔Hz〕');functionx=dtmf(key);fs=8000;N=0.1*fs;%信號(hào)時(shí)間為100ms,N=Tpmin*Fs;Tpmin根據(jù)頻率分辨率得到,DTMF信號(hào)的最小頻率間隔為73HZ,故至少需要110點(diǎn)R=1;fl=0;fh=0;n=0:100;switchkeycase{'1','2','3','A'}fl=697;case{'4','5','6','B'}fl=770;case{'7','8','9','C'}fl=852;case{'*','0','#','D'}fl=941;endswitchkeycase{'1','4','7','*'}fh=1209;case{'2','5','8','0'}fh=1336;case{'3','6','9','#'}fh=1477;case{'A','B','C','D'}fh=1633;
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2026年湖南民族職業(yè)學(xué)院?jiǎn)握芯C合素質(zhì)考試備考題庫(kù)含詳細(xì)答案解析
- 2026廣西來(lái)賓市直屬機(jī)關(guān)公開遴選和公開選調(diào)公務(wù)員15人備考考試試題及答案解析
- 2026年大連汽車職業(yè)技術(shù)學(xué)院高職單招職業(yè)適應(yīng)性測(cè)試備考試題及答案詳細(xì)解析
- 2026年湖南電氣職業(yè)技術(shù)學(xué)院?jiǎn)握芯C合素質(zhì)考試備考試題含詳細(xì)答案解析
- 2026年合肥信息技術(shù)職業(yè)學(xué)院?jiǎn)握芯C合素質(zhì)考試參考題庫(kù)含詳細(xì)答案解析
- 2026廣東佛山順德區(qū)西山小學(xué)濱江學(xué)校招聘數(shù)學(xué)臨聘教師考試重點(diǎn)題庫(kù)及答案解析
- 2026年淮北溪縣事業(yè)單位公開招聘工作人員100名參考考試題庫(kù)及答案解析
- 2026年石家莊工商職業(yè)學(xué)院?jiǎn)握新殬I(yè)技能考試備考題庫(kù)含詳細(xì)答案解析
- 2026年四川電影電視學(xué)院?jiǎn)握芯C合素質(zhì)考試備考試題含詳細(xì)答案解析
- 2026年楊凌職業(yè)技術(shù)學(xué)院?jiǎn)握新殬I(yè)技能考試備考試題含詳細(xì)答案解析
- 2025-2026學(xué)年通-用版英語(yǔ) 高一上學(xué)期期末試題(含聽力音頻答案)
- 高考英語(yǔ)3500詞分類整合記憶手冊(cè)(含完整中文釋義)
- 2025年新疆公務(wù)員《行政職業(yè)能力測(cè)驗(yàn)》試題及答案
- 中醫(yī)護(hù)理案例分享
- 骨密度檢測(cè)的臨床意義
- 食管良性腫瘤的護(hù)理
- 消防設(shè)施操作規(guī)程標(biāo)準(zhǔn)
- 2025及未來(lái)5年手持探頭項(xiàng)目投資價(jià)值分析報(bào)告
- 2025年湖南省公務(wù)員錄用考試《申論》真題(縣鄉(xiāng)卷)及答案解析
- 醫(yī)療器械專員工作計(jì)劃及產(chǎn)品注冊(cè)方案
- GB/T 20002.5-2025標(biāo)準(zhǔn)中特定內(nèi)容的編寫指南第5部分:涉及可持續(xù)性
評(píng)論
0/150
提交評(píng)論