版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、计算机与信息工程学院综合性、设计性实验报告专业: 通信工程专业 年级/班级: 2013级 20152016学年第一学期课程名称数字信号处理指导教师范海菊学号姓名13082240XX XXX实验地点计算机楼216实验时间第7-15周项目名称双音频电话拨号实验 实验类型设计性一、 实验目的理解双音频电话拨号系统的相关知识;熟悉面向对象的Matlab仿真(GUI);基于matlab的双音频电话拨号系统的功能完善(声音等);总结并分析本课题主要解决的问题及存在的问题二、 实验原理在双音频(DTMF)电话机中,包括DIMF发送器和DIMF接收器,是广泛用于快速按键话机和无线通信设备中的专用集成电路。DT
2、MF发送器能根据不同的按键号码发出相应的一组双音频信号,如图所示(其中f1、f2、f3、f4为低频群,f5、f6、f7为高频群):基本原理是由3.58Mhz的晶体振荡器分频后,得到四个高频和四个低频,在高、低频中各取一个频率合成后,就得到双音频信号。考虑到双音频信号有两个正弦信号组合而成,可假设双音频信号时域表达形式如下:其中假设每个正弦信号电压为0.25V, 为低频信号的频率,为高频信号的频率。信号每个数码发号时间大于0.04s,两个数码之间间隔时间大于0.05s,DTMF接收器对输入信号进行分离、译码、缓冲恢复为对应于16种DIMF信号。在电话机面板上4*4组合的按键组与相应的信号的表达式
3、一一对应,当按下一个数据键时,例如“5”时,则产生频率为770HZ和1336HZ的两个正弦波,并叠加成相应的双音频信号。国际电报电话咨询委员会和我国标准都规定拨号数字与高低频的组合关系如下表所示:利用MATLAB中的图形户界面GUI进行仿真双音频拨号电话在实际拨号时对应的时域波形,并利用Matlab库函数中提供的相应频域变换函数fft、abs做出每一按键时域信号的功率谱。电话拨号盘上的A、B、C、D键为保留拨号键,在本课题仿真中不对其进行仿真设计。三、 实验内容GUI的基本知识在MATLAB中,图形用户界面GUI包含多种对象的图形窗口。用户必须对每一个对象进行界面布局和编程,从而使用户激活GU
4、I每个对象时都能够执行相应的行为。另外,用户必须保存和发所创建的GUI,使得GUI能够真正得到应用。MATLAB为用户开发图形界面提供了一个方便高效的集成环境:MATLAB图形用户界面开发环境GUIDE。GUIDE主要是一个界面设计工具集,MATLAB将所有GUI支持的用户控件都集成在这个环境中提供界面外观、属性和行为响应方式的设置方法。GUIDE将用户保存设计好的GUI界面保存在一个FIG资源文件中,同时还能生成包含GUI初始化和组件界面布局控制代码的M文件。这个M文件为实现回调函数(当用户激活GUI某已组件时执行的函数)提供了一个参考框架。虽然使用用户自己编写的、包含GUI所有发布命令的M
5、文件也能够实现一个GUI,但是GUIDE执行效率更高:使用GUIDE不但能够交互式地进行组件界面布局,而且能够生成两个用来保存和发布GUI的文件。GUI界面设计图形界面(GUI)就是通过窗口、选单、按钮、文字说明等构成一个美观的界面,提供用户利用鼠标或键盘方便地实现操作。Matlab设计图形用户界面的方法有两种:使用可视化的界面环境和通过编写程序,本课题采用可视化的界面环境仿真双音频拨号电话。通过打开MATLAB的菜单File/New/GUI即可打开如下的窗口,选择Create New GUI 选单中的“Blank GUI(Default)”后设置相应的存储位置,单击OK即可得到如下未命名的图
6、形用户界面“untitled.fig”编辑器外观:在弹出的“untitled.fig”的图形对象面板中选择可用来仿真双音频电话面板的各个控件,并设置各个控件的属性值以便在编写回调函数(Callback)时有效利用各个控件的属性值,使编写的函数易于读懂。单击运行后的得到如下的图像界面:实现GUI的基本机制是对控件的Callback属性编程以期实现界面上各个控件的功能。在本课题中对各个控件的Callback进行编程后再次运行时,用鼠标单出现的界面如下。同时可实现语音报号的功能。可实现对输入的按键音响声。点击“拨号”按键,可出现快速拨号的拨号音,并在“您拨的号码是”的显示框
7、显示,得到的图形界面如下:点击“清除”按键即可实现,对所有显示框内容的清除功能。进一步说明当单独拨号“*、#”按键时,无法显示对应的字符,只能显示数字字符;如果混合拨号时,则“*、#”自动译成临近的数字,已临近的数字代替显示,具体情况如下图显示:针对这种情况的有关程序有待进一步完善,在此不做深入解决,基本已经实现双音频的合成与重现,并以较为友好的GUI界面显示出来,基本达到实验要求目的。四、 实验源程序段展示 function varargout = T1(varargin)% T1 MATLAB code for T1.fig% T1, by itself, creates a new T1
8、 or raises the existing% singleton*.JJ% H = T1 returns the handle to a new T1 or the handle to% the existing singleton*.% T1('CALLBACK',hObject,eventData,handles,.) calls the local% function named CALLBACK in T1.M with the given input arguments.% T1('Property','Value',.) crea
9、tes a new T1 or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before T1_OpeningFcn gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to T1_OpeningFcn via varargin.% Begin initia
10、lization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, . 'gui_Singleton', gui_Singleton, . 'gui_OpeningFcn', T1_OpeningFcn, . 'gui_OutputFcn', T1_OutputFcn, . 'gui_LayoutFcn', , . 'gui_Callback', );if nargin && i
11、schar(varargin1) gui_State.gui_Callback = str2func(varargin1);endif nargout varargout1:nargout = gui_mainfcn(gui_State, varargin:);else gui_mainfcn(gui_State, varargin:);end% End initialization code - DO NOT EDIT% - Executes just before T1 is made visible.function T1_OpeningFcn(hObject, eventdata, h
12、andles, 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 command line arguments to T1 (see VARARGIN)% Choose default command li
13、ne output for T1handles.output = hObject;% Update handles structureguidata(hObject, handles);set(handles.edit1,'string',''); set(handles.edit2,'string',''); global NUM NUM=NUM(1:0);% UIWAIT makes T1 wait for user response (see UIRESUME)% uiwait(handles.figure1);% - Ou
14、tputs from this function are returned to the command line.function varargout = T1_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 wi
15、th handles and user data (see GUIDATA)% Get default command line output from handles structurevarargout1 = handles.output;% - Executes on button press in pushbutton2.%function pushbutton2_Callback(hObject, eventdata, handles)function varargout = pushbutton2_Callback(h, eventdata, handles, varargin)
16、n=1:1000; fh4=1209;fl4=770;fs=8192;d0=sin(2*pi*fh4/fs*n)+sin(2*pi*fl4/fs*n);n0=strcat(get(handles.edit1,'string'),'4'); set(handles.edit1,'string',n0); space=zeros(1,100);global NUM phone=NUM,d0; NUM=phone,space; wavplay(d0,8192);% hObject handle to pushbutton2 (see GCBO)% ev
17、entdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% - Executes on key press with focus on pushbutton2 and none of its controls.function pushbutton2_KeyPressFcn(hObject, eventdata, handles)% hObject handle to pushbutton2 (see GCB
18、O)% eventdata structure with the following fields (see UICONTROL)%Key: name of the key that was pressed, in lower case%Character: character interpretation of the key(s) that was pressed%Modifier: name(s) of the modifier key(s) (i.e., control, shift) pressed% handles structure with handles and user d
19、ata (see GUIDATA)% - Executes on button press in pushbutton3.%function pushbutton3_Callback(hObject, eventdata, handles)function varargout = pushbutton3_Callback(h, eventdata, handles, varargin) n=1:1000;fh5=1336;fl5=770;fs=8192;d0=sin(2*pi*fh5/fs*n)+sin(2*pi*fl5/fs*n);n0=strcat(get(handles.edit1,
20、39;string'),'5'); set(handles.edit1,'string',n0); space=zeros(1,100); global NUM phone=NUM,d0; NUM=phone,space;wavplay(d0,8192); % hObject handle to pushbutton3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user d
21、ata (see GUIDATA)% - Executes on button press in pushbutton4.%function pushbutton4_Callback(hObject, eventdata, handles)function varargout = pushbutton4_Callback(h, eventdata, handles, varargin) n=1:1000; fh6=1477;fl6=770;fs=8192;d0=sin(2*pi*fh6/fs*n)+sin(2*pi*fl6/fs*n);n0=strcat(get(handles.edit1,&
22、#39;string'),'6'); set(handles.edit1,'string',n0);space=zeros(1,100);global NUM phone=NUM,d0; NUM=phone,space;wavplay(d0,8192);% hObject handle to pushbutton4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user dat
23、a (see GUIDATA)% - Executes on button press in pushbutton5.%function pushbutton5_Callback(hObject, eventdata, handles)function varargout = pushbutton5_Callback(h, eventdata, handles, varargin) n=1:1000;fh7=1209;fl7=852;fs=8192; d0=sin(2*pi*fh7/fs*n)+sin(2*pi*fl7/fs*n);n0=strcat(get(handles.edit1,
24、9;string'),'7');set(handles.edit1,'string',n0); space=zeros(1,100);global NUM phone=NUM,d0; NUM=phone,space; wavplay(d0,8192); % hObject handle to pushbutton5 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user dat
25、a (see GUIDATA)% - Executes on button press in pushbutton6.%function pushbutton6_Callback(hObject, eventdata, handles)function varargout = pushbutton6_Callback(h, eventdata, handles, varargin) n=1:1000;fh1=1209;fl1=697;fs=8192;d0=sin(2*pi*fh1/fs*n)+sin(2*pi*fl1/fs*n);n0=strcat(get(handles.edit1,'
26、;string'),'1');set(handles.edit1,'string',n0); space=zeros(1,100); global NUM phone=NUM,d0; NUM=phone,space; wavplay(d0,8192); % - Executes on button press in pushbutton7.%function pushbutton7_Callback(hObject, eventdata, handles)function varargout = pushbutton7_Callback(h, event
27、data, handles, varargin) n=1:1000;fh8=1336;fl8=852;fs=8192;d0=sin(2*pi*fh8/fs*n)+sin(2*pi*fl8/fs*n);n0=strcat(get(handles.edit1,'string'),'8');set(handles.edit1,'string',n0); space=zeros(1,100); global NUM phone=NUM,d0; NUM=phone,space;wavplay(d0,8192);% - Executes on button
28、press in pushbutton8.%function pushbutton8_Callback(hObject, eventdata, handles)function varargout = pushbutton8_Callback(h, eventdata, handles, varargin) n=1:1000; fh11=1477;fl11=941;fs=8192;d0=sin(2*pi*fh11/fs*n)+sin(2*pi*fl11/fs*n);n0=strcat(get(handles.edit1,'string'),'#'); set(h
29、andles.edit1,'string',n0);space=zeros(1,100);global NUM phone=NUM,d0; NUM=phone,space; wavplay(d0,8192); % - Executes on button press in pushbutton9.%function pushbutton9_Callback(hObject, eventdata, handles)function varargout = pushbutton9_Callback(h, eventdata, handles, varargin) n=1:1000;
30、fh2=1336;fl2=697;fs=8192;d0=sin(2*pi*fh2/fs*n)+sin(2*pi*fl2/fs*n);n0=strcat(get(handles.edit1,'string'),'2'); set(handles.edit1,'string',n0); space=zeros(1,100); global NUM phone=NUM,d0; NUM=phone,space; wavplay(d0,8192); % 频率表fh0=1336;fl0=941;fh1=1209;fl1=697;fh2=1336;fl2=69
31、7;fh3=1477;fl3=697;fh4=1209;fl4=770;fh5=1336;fl5=770;fh6=1477;fl6=770;fh7=1209;fl7=852;fh8=1336;fl8=852;fh9=1477;fl9=852;fh10=1209;fl10=941;%*fh11=1477;fl11=941;%#fs=8192;%产生的声音的采样hz% - Executes on button press in pushbutton10.%function pushbutton10_Callback(hObject, eventdata, handles)function vara
32、rgout = pushbutton10_Callback(h, eventdata, handles, varargin) n=1:1000;fh0=1336;fl0=941;fs=8192;d0=sin(2*pi*fh0/fs*n)+sin(2*pi*fl0/fs*n);n0=strcat(get(handles.edit1,'string'),'0');set(handles.edit1,'string',n0); space=zeros(1,100); global NUM phone=NUM,d0; NUM=phone,space;wa
33、vplay(d0,8192); % - Executes on button press in pushbutton11.%function pushbutton11_Callback(hObject, eventdata, handles)function varargout = pushbutton11_Callback(h, eventdata, handles, varargin) n=1:1000;fh3=1477;fl3=697;fs=8192;d0=sin(2*pi*fh3/fs*n)+sin(2*pi*fl3/fs*n);n0=strcat(get(handles.edit1,
34、'string'),'3');set(handles.edit1,'string',n0);space=zeros(1,100); global NUM phone=NUM,d0; NUM=phone,space; wavplay(d0,8192);% - Executes on button press in pushbutton12.%function pushbutton12_Callback(hObject, eventdata, handles)function varargout = pushbutton12_Callback(h,
35、eventdata, handles, varargin) n=1:1000; fh10=1209;fl10=941;fs=8192;d0=sin(2*pi*fh10/fs*n)+sin(2*pi*fl10/fs*n);n0=strcat(get(handles.edit1,'string'),'*'); set(handles.edit1,'string',n0); space=zeros(1,100); global NUM phone=NUM,d0; NUM=phone,space;wavplay(d0,8192); % - Execute
36、s on button press in pushbutton13.%function pushbutton13_Callback(hObject, eventdata, handles)function varargout = pushbutton13_Callback(h, eventdata, handles, varargin) n=1:1000;fh9=1477;fl9=852;fs=8192;d0=sin(2*pi*fh9/fs*n)+sin(2*pi*fl9/fs*n);n0=strcat(get(handles.edit1,'string'),'9'); set(handles.edit1,'string',n0);space=zeros(
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026广东汕尾市海丰县消防救援局招聘政府专职消防员10人笔试备考试题及答案解析
- 2026年10月福州市劳动就业中心就业辅助员公益性岗位招聘1人考试备考试题及答案解析
- 中石化中原石油工程有限公司2027届校园招聘笔试模拟试题及答案解析
- 2026年庆安县教师招聘考试参考题库及答案解析
- 2026年铁岭县教师招聘考试模拟试题及答案解析
- 宜宾三江汇智人力资源服务有限公司2026年第十二批公开招聘外派项目工作人员的(2人)考试模拟试题及答案解析
- 2026年10月广东广州市天河区侨乐小学招聘编外聘用制专任教师1人考试参考题库及答案解析
- 2026年其他危险品仓储行业产业趋势报告及未来五至十年市场空间与盈利前景
- 2026年梨树县教师招聘笔试参考题库及答案解析
- 2026重庆市西部水资源开发有限公司招聘6人笔试备考试题及答案解析
- 鹿茸片销售合同
- 超声内镜诊疗中国指南(2026 版)
- 重温七一重要讲话精神
- 智联猎头:2026年企业薪酬调研报告
- 宫颈癌护理新进展与趋势
- 场景美术创作技法
- 冷却塔填料更换施工方法方案
- GB/T 20042.4-2025质子交换膜燃料电池第4部分:电催化剂测试方法
- 2025年军事理论与国防教育考试题及答案
- 化解矛盾拥抱友谊主题班会
- DB50T 1021-2020 电动汽车简易型交流供电装置技术规范
评论
0/150
提交评论