资源简介
matlab下dtmf的实现代码,应该还是比较好用的

代码片段和文件信息
function [B] = decode(ZAfad)
%
% This programm analyze a frequency coded signalvector and sort the won
% frequencies its key.
%
% example: [B] = decode(ZA4000)
%
% Z : frequency coded signalvector
% A : dtmf key vector
% fa : sampling rate in hz
% d : time in seconds
% B : key vector
n=length(A);
for k=1:n;
% fft analyze of the frequency coded signalvector
temp=abs(fft(Z(k:)));
% Analyze to the half sampling rate because the frequencies after are
% not interesting for analyze. They were created by sampling the signal
x=1:(fa/2)*d;
% maximum of the array
[ai]=max(temp(x));
% frequency 1
f1=(i/d)-1;
% set the actuall x coordinate at area +/-10 to 0
i=i-10:i+10;
temp(i)=0;
% maximum of the array
[ai]=max(temp(x));
% frequency 2
f2=(i/d)-1;
% frequency sort
if f1>1000
var=f1;
f1=f2;
f2=var;
elseif f1<1000
end
% msgbox(num2str(f1));
% msgbox(num2str(f2));
% include frequency tolerance and sort the key frequencies (the actuall
% tolerance are at with time: >= 0.0499 s and sampling rate: 3300Hz)
if ((f1>692) && (f1<720))
f1=697;
elseif ((f1>765) && (f1<800))
f1=770;
elseif ((f1>847) && (f1<880))
f1=852;
elseif ((f1>936) && (f1<960))
f1=941;
end
if ((f2>1204) && (f2<1240))
f2=1209;
elseif ((f2>1331) && (f2<1360))
f2=1336;
elseif ((f2>1472) && (f2<1500))
f2=1477;
elseif ((f2>1628) && (f2<1660))
f2=1633;
end
% msgbox(num2str(f1))
% msgbox(num2str(f2))
% sort the evaluated frequencies to the keys
switch(f1);
case{697};
switch(f2);
case{1209};
taste=‘1‘;
case{1336};
taste=‘2‘;
case{1477};
taste=‘3‘;
case{1633};
taste=‘A‘;
end
case{770};
switch(f2);
case{1209};
taste=‘4‘;
case{1336};
taste=‘5‘;
case{1477};
taste=‘6‘;
case{1633};
taste=‘B‘;
end
case{852};
switch(f2);
case{1209};
taste=‘7‘;
case{1336};
taste=‘8‘;
case{1477};
taste=‘9‘;
case{1633};
taste=‘C‘;
end
case{941};
switch(f2);
case{1209};
taste=‘*‘;
case{1336};
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1041 2006-03-18 15:26 genfcs.m
文件 1724 2006-03-18 15:20 main_program_dtmf.m
文件 3269 2006-03-18 15:25 decode.m
文件 1438 2006-03-18 15:33 encode.m
- 上一篇:matlab孤立点提取函数
- 下一篇:Boosting matlab代码
相关资源
- matlab_OFDM调制解调(来自剑桥大学)
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
评论
共有 条评论