资源简介
DTMF2NUM是一个小工具,可以帮助你从PCM解码波形文件和MF的DTMF音调。它支持任何文件类型的波(频率,频道和8,16,24和32位),自动优化(直流偏置调整和正常化)和两个WAV和原始的PCM数据。
代码片段和文件信息
/*
* Asterisk -- An open source telephony toolkit.
*
* Copyright (C) 1999 - 2005 Digium Inc.
*
* Mark Spencer
*
* Goertzel routines are borrowed from Steve Underwood‘s tremendous work on the
* DTMF detector.
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site mailing lists and IRC
* channels for your use.
*
* This program is free software distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
*/
/*! \file
*
* \brief Convenience Signal Processing routines
*
* \author Mark Spencer
* \author Steve Underwood
*/
/* Some routines from tone_detect.c by Steven Underwood as published under the zapata library */
/*
tone_detect.c - General telephony tone detection and specific
detection of DTMF.
Copyright (C) 2001 Steve Underwood
Despite my general liking of the GPL I place this code in the
public domain for the benefit of all mankind - even the slimy
ones who might try to proprietize my work and use it to my
detriment.
*/
/*
modifications for decoding also damaged audio by Luigi auriemma “// aluigi work-around“
*/
#include
#include
#include
#include
#include
#include
#define DSP_DIGITMODE_DTMF 0 /*!< Detect DTMF digits */
#define DSP_DIGITMODE_MF 1 /*!< Detect MF digits */
#define DSP_DIGITMODE_NOQUELCH (1 << 8) /*!< Do not quelch DTMF from in-band */
#define DSP_DIGITMODE_RELAXDTMF (1 << 11) /*!< “Radio“ mode (relaxed DTMF) */
#define MAX_DTMF_DIGITS 1024
/* Basic DTMF specs:
*
* Minimum tone on = 40ms
* Minimum tone off = 50ms
* Maximum digit rate = 10 per second
* Normal twist <= 8dB accepted
* Reverse twist <= 4dB accepted
* S/N >= 15dB will detect OK
* Attenuation <= 26dB will detect OK
* Frequency tolerance +- 1.5% will detect +-3.5% will reject
*/
//#define DTMF_THRESHOLD 8.0e7
#define DTMF_THRESHOLD 800000000.0 // aluigi work-around
#define DTMF_NORMAL_TWIST 6.3 /* 8dB */
#ifdef RADIO_RELAX
#define DTMF_REVERSE_TWIST ((digitmode & DSP_DIGITMODE_RELAXDTMF) ? 6.5 : 2.5) /* 4dB normal */
#else
#define DTMF_REVERSE_TWIST ((digitmode & DSP_DIGITMODE_RELAXDTMF) ? 4.0 : 2.5) /* 4dB normal */
#endif
#define DTMF_RELATIVE_PEAK_ROW 6.3 /* 8dB */
#define DTMF_RELATIVE_PEAK_COL 6.3 /* 8dB */
#define DTMF_2ND_HARMONIC_ROW ((digitmode & DSP_DIGITMODE_RELAXDTMF) ? 1.7 : 2.5) /* 4dB normal */
#define DTMF_2ND_HARMONIC_COL 63.1 /* 18dB */
#define DTMF_TO_TOTAL_ENERGY 42.0
//#define BELL_MF_THRESHOLD 1.6e9
#define BELL_MF_THRESHOLD DTMF_THRESHOLD // aluigi work-around
#define BELL_MF_TWIST 4.0 /* 6dB */
#define BELL_MF_RELATIVE_PEAK 12.6 /* 11dB */
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5 2012-09-02 09:29 a.bat
文件 14642 2008-03-31 14:12 dsp.c
文件 9842 2008-06-05 23:39 dtmf2num.c
文件 17920 2008-06-05 23:40 dtmf2num.exe
文件 343 2008-04-05 15:56 Makefile
文件 6172 2006-08-06 11:06 mywav.h
文件 11598 2008-03-30 21:19 resample2.c
文件 56364 2012-09-02 01:19 t1.wav
----------- --------- ---------- ----- ----
116886 8
评论
共有 条评论