双音多频拨号系统DTMF的实验报告_第1页
双音多频拨号系统DTMF的实验报告_第2页
双音多频拨号系统DTMF的实验报告_第3页
双音多频拨号系统DTMF的实验报告_第4页
双音多频拨号系统DTMF的实验报告_第5页
已阅读5页,还剩16页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

双音多频拨号系统 DTMF 的实验设计报 告 所谓双音多频 DTMF 就是用两个频率 行频和列 频来表示电话机键盘上的一个数字 DTMF 电话的指令正在 迅速的取代脉冲指令 除了在电话呼叫信号中使用外 DTMF 还广泛的使用在交互式控制应用 例如电话银行 电 子邮件甚至家电远程控制等 用户可以从电话机发送 DTMF 信号来做菜单选择 本文基于 MATLAB 的双音多频拨号系统 的仿真实现 主要涉及到电话拨号音合成的基本原理及识 别的主要方法 利用 MATLAB 软件以及 DFT 算法实现对电 话通信系统中拨号音的合成与识别 并进一步利用 MATLAB 中的图形用户界面 GUI 制作简单直观的模拟界面 还能够 利用矩阵不同的基频合成 0 9 不同按键的拨号音 并 能够对不同的拨号音加以正确的识别 实现由拨号音解析 出电话号码的过程 进一步利用 GUI 做出了简单的图形操 作界面 本文具有界面清楚 画面简洁 易于理解 操作 简单的优点 从而实现对电话拨号音系统的简单的信号仿 真 关键词 双音多频 DTMF MATLAB GUI 信号仿真 在电话中 数字 0 9 的中每一个都用两个不同的单音 频传输 所用的 8 个频率分成高频带和低频带两组 低频 带有四个频率 679Hz 770Hz 852Hz 和 941Hz 高频带也 有四个频率 1209Hz 1336Hz 1477Hz 和 1633Hz 每一 个数字均由高 低频带中各一个频率构成 例如 1 用 697Hz 和 1209Hz 两个频率 信号用 表示 其中 这样 8 个 频率形成 16 种不同的双频信号 一 利用 GUI 作图 简单的电话界面 如下 利用 GUI 图 形用户界面设计工具制作电话拨号面板 把 DTMF 信号和 电话机的键盘矩阵对应起来 其中选用我们熟悉的 10 个 数字键 0 9 3 个功能键 回删 拨号 解码 按照图 电话机键盘矩阵的排列方式制作五行三列的按 键控件 每个按键可用 Push Button 添加 静态文 本框可用 Static Text 添加 如图再加个解码键 Push Button 二 再点运行 得出与上图对应的 m 文件 再用鼠标右 击上图的每个键 点 callback 导入每个键的编译程序如下 1 按键1的程序 Executes on button press in pushbutton4 function pushbutton4 Callback hObject eventdata handles x get handles text1 string 把数字显示在屏幕上 if length x 15 errordlg Sorry The number you have input is too long Input Error modal else n 1 1000 每个数字1000个采样点 y sin 0 5345 n sin 0 9272 n 对应行频列频时域叠加 数字1的低频697Hz和高频1209Hz叠加 wavplay y 8192 产生拨号音 space zeros 1 100 100个0模拟静音信号 global NUM phone NUM y 循环储存 NUM phone space 储存连续的拨号音信号 NoCtrl x NoCtrl NoCtrl 1 set handles text1 string NoCtrl end 2 按键2的程序 function pushbutton5 Callback hObject eventdata handles x get handles text1 string 把数字显示在屏幕上 if length x 15 errordlg Sorry The number you have input is too long Input Error modal else n 1 1000 每个数字1000个采样点 y sin 0 5345 n sin 1 0247 n 对应行频列频时域叠 加 数字2的低频697Hz和高频1336Hz叠加 wavplay y 8192 产生拨号音 space zeros 1 100 100个0模拟静音信号 global NUM phone NUM y 循环储存 NUM phone space 储存连续的拨号音信号 NoCtrl x NoCtrl NoCtrl 2 set handles text1 string NoCtrl end 3 按键3的程序 Executes on button press in pushbutton6 function pushbutton6 Callback hObject eventdata handles x get handles text1 string 把数字显示在屏幕上 if length x 15 errordlg Sorry The number you have input is too long Input Error modal else n 1 1000 每个数字1000个采样点 y sin 0 5345 n sin 1 1328 n 对应行频列频时域叠 加 数字3的低频697Hz和高频1477Hz叠加 wavplay y 8192 产生拨号音 space zeros 1 100 100个0模拟静音信号 global NUM phone NUM y 循环储存 NUM phone space 储存连续的拨号音信号 NoCtrl x NoCtrl NoCtrl 3 set handles text1 string NoCtrl end 4 按键4的程序 Executes on button press in pushbutton10 function pushbutton10 Callback hObject eventdata handles x get handles text1 string 把数字显示在屏幕上 if length x 15 errordlg Sorry The number you have input is too long Input Error modal else n 1 1000 每个数字1000个采样点 y sin 0 5905 n sin 0 9272 n 对应行频列频时域叠 加 数字4的低频770Hz和高频1209Hz叠加 wavplay y 8192 产生拨号音 space zeros 1 100 100个0模拟静音信号 global NUM phone NUM y 循环储存 NUM phone space 储存连续的拨号音信号 NoCtrl x NoCtrl NoCtrl 4 set handles text1 string NoCtrl end 5 按键5的程序 Executes on button press in pushbutton9 function pushbutton9 Callback hObject eventdata handles x get handles text1 string 把数字显示在屏幕上 if length x 15 errordlg Sorry The number you have input is too long Input Error modal else n 1 1000 每个数字1000个采样点v y sin 0 5905 n sin 1 0247 n 对应行频列频时域叠 加 数字5的低频770Hz和高频1336Hz叠加 wavplay y 8192 产生拨号音 space zeros 1 100 100个0模拟静音信号 global NUM phone NUM y 循环储存 NUM phone space 储存连续的拨号音信号 NoCtrl x NoCtrl NoCtrl 5 set handles text1 string NoCtrl end 6 按键6的程序 Executes on button press in pushbutton8 function pushbutton8 Callback hObject eventdata handles x get handles text1 string 把数字显示在屏幕上 if length x 15 errordlg Sorry The number you have input is too long Input Error modal else n 1 1000 每个数字1000个采样点 y sin 0 5905 n sin 1 1328 n 对应行频列频时域叠 加 数字6的低频770Hz和高频1477Hz叠加 wavplay y 8192 产生拨号音 space zeros 1 100 100个0模拟静音信号 global NUM phone NUM y 循环储存 NUM phone space 储存连续的拨号音信号 NoCtrl x NoCtrl NoCtrl 6 set handles text1 string NoCtrl end 7 按键7的程序 Executes on button press in pushbutton13 function pushbutton13 Callback hObject eventdata handles x get handles text1 string 把数字显示在屏幕上 if length x 15 errordlg Sorry The number you have input is too long Input Error modal else n 1 1000 每个数字1000个采样点 y sin 0 6534 n sin 0 9272 n 对应行频列频时域叠 加 数字7的低频852Hz和高频1209Hz叠加 wavplay y 8192 产生拨号音 space zeros 1 100 100个0模拟静音信号 global NUM phone NUM y 循环储存 NUM phone space 储存连续的拨号音信号 NoCtrl x NoCtrl NoCtrl 7 set handles text1 string NoCtrl end 8 按键8的程序 Executes on button press in pushbutton12 function pushbutton12 Callback hObject eventdata handles x get handles text1 string 把数字显示在屏幕上 if length x 15 errordlg Sorry The number you have input is too long Input Error modal else n 1 1000 每个数字1000个采样点 y sin 0 6534 n sin 1 0247 n 对应行频列频时域叠 加 数字8的低频852Hz和高频1336Hz叠加 wavplay y 8192 产生拨号音 space zeros 1 100 100个0模拟静音信号 global NUM phone NUM y 循环储存 NUM phone space 储存连续的拨号音信号 NoCtrl x NoCtrl NoCtrl 8 set handles text1 string NoCtrl end 9 按键9的程序 Executes on button press in pushbutton14 function pushbutton14 Callback hObject eventdata handles x get handles text1 string 把数字显示在屏幕上 if length x 15 errordlg Sorry The number you have input is too long Input Error modal else n 1 1000 每个数字1000个采样点 y sin 0 6534 n sin 1 1328 n 对应行频列频时域叠 加 数字9的低频852Hz和高频1477Hz叠加 wavplay y 8192 产生拨号音 space zeros 1 100 100个0模拟静音信号 global NUM phone NUM y 循环储存 NUM phone space 储存连续的拨号音信号 NoCtrl x NoCtrl NoCtrl 9 set handles text1 string NoCtrl end 10 按键0的程序 Executes on button press in pushbutton17 function pushbutton17 Callback hObject eventdata handles x get handles text1 string 把数字显示在屏幕上 if length x 15 errordlg Sorry The number you have input is too long Input Error modal else n 1 1000 每个数字1000个采样点 y sin 0 7217 n sin 1 0247 n 对应行频列频时域叠 加 数字0的低频941Hz和高频1336Hz叠加 wavplay y 8192 产生拨号音 space zeros 1 100 100个0模拟静音信号 global NUM phone NUM y 循环储存 NUM phone space 储存连续的拨号音信号 NoCtrl x NoCtrl NoCtrl 0 set handles text1 string NoCtrl end 11 按键 号程序 Executes on button press in pushbutton16 function pushbutton16 Callback hObject eventdata handles set handles text1 string set handles tbutton visible off set handles tbutton value 0 clear all 12 按键 的程序 Executes on button press in pushbutton18 function pushbutton18 Callback hObject eventdata handles set handles text1 string set handles tbutton visible off set handles tbutton value 0 clear all 13 回删键的程序 Executes on button press in pushbutton20 function pushbutton20 Callback hObject eventdata handles x get handles text1 string 把数字显示在屏幕上 if isempty x errordlg Please input the phone No Input error modal else xll length x x xll 去掉末尾号在面板上的显示 set handles text1 string x global NUM ll length NUM 删除末尾号码在拨号音信号中的储存 for i ll 1100 1 ll NUM ll ll length NUM end end 14 拨号键的程序 Executes on button press in pushbutton21 function pushbutton21 Callback hObject eventdata handles x get handles text1 string 把数字显示在屏幕上 xx str2num x global NUM if isempty NUM errordlg Please input the phone No Input error modal else wavplay NUM 8192 msgbox 拨号成功 若需再次拨号请按 号复位 Done help set handles tbutton visible on set handles text1 string Dieling Done end 14 关闭键的程序 Executes on button press in pushbutton22 function pushbutton22 Callback hObject eventdata handles clear all close all 15 解码的程序 Executes on button press in tbotton function tbotton Callback hObject eventdata handles global NUM L length NUM n L 1100 number for i 1 n j i 1 1100 1 d NUM j j 999 截取出每个数字 f fft d 2048 以N 2048作FFT变换 a abs f p a a 10000 计算功率谱 num 1 find p 1 250 max p 1 250 找行频通过 计算得出数值范围 num 2 300 find p 300 380 max p 300 380 找 列频通过计算得出数值范围 if num 1 180 row 1 确定行数 elseif num 1 200 row 2 elseif num 1 220 row 3 else row 4 end if num 2 320 column 1 确定列数 elseif num 2 340 column 2 else column 3 end z row column 确定数字 if z 4 2 tel 0 0在4行2列 elseif z 1 1 tel 1 1在1行1列 elseif z 1 2 tel 2 2在1行2列 elseif z 1 3 tel 3 3在1行3列 elseif z 2 1 tel 4 4在2行1列 elseif z 2 2 tel 5 5在2行2列 elseif z 2 3 tel 6 6在2行3列 elseif z 3 1 tel 7 7在3行1列 elseif z 3 2 tel 8 8在3行2列 elseif z 3 3 tel 9 9在3行3列 end t i tel c strcat number int2str tel number c i i 1 end set handles text1 string 解码中 h waitbar 0 Decoding Please wait steps 1500 for step 1 steps computations take place here waitbar step steps end close h set handles text1 string number hObject handle

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论