大连理工大学数字信号处理实验二电话拨号音的合成与识别
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
大连理工大学实验报告
学院(系):电子信息与电气工程专业:电子信息工程班级:姓名:学号:组:___
实验时间:实验室:实验台:指导教师签字:成绩:实验二、电话拨号音的合成与识别一、实验题目和代码
实现对电话通信系统中拨号音合成与识别的仿真实现。
系统界面设计:
源程序:
function varargout = zuoye(varargin)
function zuoye_OpeningFcn(hObject, eventdata, handles, 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 GUIDA TA)
% varargin command line arguments to zuoye (see V ARARGIN)
% Choose default command line output for zuoye
handles.output = hObject;
handles.fs = 8192;
handles.DTMFsum=820;
handles.DTMFnum = handles.DTMFsum/2;
handles.NUM=[];
handles.number = [];
function num1_Callback(hObject, eventdata, handles)
% hObject handle to num1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDA TA)
n0=strcat(get(handles.numshow,'string'),'1'); % 获取数字号码
set(handles.numshow,'string',n0); % 显示号码
n=[1:handles.DTMFnum]; % 每个数字410 个采样点表示
d0=sin(2*pi*697/handles.fs*n)+sin(2*pi*1209/handles.fs*n); % 对应行频列频叠加space=zeros(1,handles.DTMFnum); %400 个0 模拟静音信号
phone=[handles.NUM,d0];
handles.NUM=[phone,space]; % 存储连续的拨号音信号
guidata(hObject, handles);
wavplay(d0,8192);
function num10_Callback(hObject, eventdata, handles)
% hObject handle to num10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDA TA)
n=[1:1000];
num=get(handles.numshow,'string');
L=length(num);
n11=strrep(num,num,num(1:L-1));
d11=sin(0.7217*n)+sin(0.9273*n);
set(handles.numshow,'string',n11);
L=length(handles.NUM);
handles.NUM=handles.NUM(1:L-820);
guidata(hObject, handles);
wavplay(d11,8192);
function num11_Callback(hObject, eventdata, handles)
% hObject handle to num11 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDA TA)
L=length(handles.NUM);
n=L/handles.DTMFsum;
number='';
for i=1:n
j=(i-1)*handles.DTMFsum+1;
d=handles.NUM(j:j+(handles.DTMFnum-1)); % 截取出每个数字f=fft(d,8192); % 以N=2048 作FFT 变换
a=abs(f);
p=a.*a/handles.fs; % 计算功率谱
% p=a.*a/10000; % 计算功率谱
num(1)=find(p(1:1000)==max(p(1:1000))); % 找行频
num(2)=1000+find(p(1000:1700)==max(p(1000:1700))); % 找列频if (num(1) < 730)
row=1; % 确定行数
elseif (num(1) < 810)
row=2;