matlab电话拨号音的合成与识别代码,实验报告 电话拨号音的合成与识别
大連理工大學實驗報告 學院(系): 電信 專業: 電子信息工程 班級: 電子1302 姓名: 曾昱 學號: 201311066 組: 實驗時間: 實驗室: 實驗臺: 指導教師簽字: 成績: 電話撥號音的合成與識別 一、實驗目的和要求 電話撥號音合成的基本原理及識別的主要方法 利用 MATLAB 軟件以及 FFT 算法實現對電話通信系統中撥號音的合成與識別 并進一步利用 MATLAB 中的圖形用戶界面 GUI 制作簡單直觀的模擬界面。 三、題目 1)產生撥號界面,顯示播出的號碼,產生電話撥號音 2)識別撥號音并顯示在界面上 三、代碼和運行結果 按鍵識別、產生撥號音: % --- Executes on button press in pushbutton1. function pushbutton1_Callback(hObject, eventdata, handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defi ned in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) n = [1:410]; d0 = sin(2*pi*697*n/8192) + sin(2*pi*1209*n/8192); space = zeros(1, 410); phone = [d0, space]; handles.numsig = [handles.numsig, phone]; num = get(handles.numbershow, String); newnum = strcat(num, 1); set(handles.numbershow, String, newnum); sound(d0,8192) guidata(hObject, handles); 刪除鍵: % --- Executes on button press in pushbuttonf1. function pushbuttonf1_Callback(hObject, eventdata, handles) % hObject handle to pushbuttonf1 (see GCBO) % eventdata reserved - to be defi ned in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) num = get(handles.numbershow,String); %??????????? num = num(1:end-1);%???? handles.numsig = handles.numsig(1:end-820); set(handles.numbershow,String,num);%???? n=[1:410]; d11=sin(0.7217*n)+sin(0.9273*n); sound(d11,8192); %????????? guidata(hObject, handles); 撥出鍵,撥出號碼后通過產生的序列識別撥出的號碼: % --- Executes on button press in pushbuttonf2.?? function pushbuttonf2_Callback(hObject, eventdata, handles) % hObject handle to pushbuttonf2 (see GCBO) % eventdata reserved - to be defi ned in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) numtable = [1 2 3;4 5 6;7 8 9;* 0 #]; for i = 1:length(handles.numsig)/820 f = fft(handles.numsig((i-1)*820 +1:i*820), 8192);%???????? a = abs(f); fi nd(a(1:1000)==max(a(1:1000))) frequency(1) = fi nd(a(1:1000)==max(a(1:1000))); frequency(2) = 1000 + fi nd(a(1000:1700)==max(a(1000:1700))); if(frequency(1) < 730) row = 1; elseif(frequency(1) < 810) row = 2; elseif(frequency(1) < 900) row = 3; else row = 4; end if(frequency(2) < 1280) column = 1; elseif(frequency(2) < 1400) column = 2; else column = 3; end identifyNum(i) = numtable(row, column); end 結果: ? 圖1-撥號界面 五、實驗總結 接收端收到信號后,取出每位電話號碼對應的正弦信號,進行fft變換后通過找幅度最大的頻率來確 定這一位號碼的行和列。從行和列到具體的這一位電話號碼的數字,我是這樣做的,建立一個號碼 表,根據從信號頻率得到的行數和列數來查表。 numtable = [1 2 3;4 5 6;7 8 9;* 0 ‘#’]; … ?????????? … identifyNum(i) = numtable(row, column);
展開閱讀全文
總結
以上是生活随笔為你收集整理的matlab电话拨号音的合成与识别代码,实验报告 电话拨号音的合成与识别的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java的初始,Java初始
- 下一篇: oracle终止dbms调度,Oracl