在Python中解析(提取)DTMF

发布于 2024-09-06 04:02:25 字数 116 浏览 2 评论 0原文

如果我有一个录制的音频文件(MP3),有什么方法可以找出用纯Python录制的DTMF音吗?

(如果纯Python不可用,那么Java也可以。重点是它应该能够在Google Appengine中运行)

If I have a recorded audio file (MP3), is there any way to get the figure out the DTMF tones that were recorded in pure Python?

(If pure python is not available, then Java is okay too. The point being that it should be able to run in Google Appengine)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夜深人未静 2024-09-13 04:02:25

首先,您需要以给定的位深度和采样率将 MP3 解码为原始样本的未压缩格式。然后查找构成每个 DTMF 音调的频率。虽然 FFT 可用于此目的,但规范的算法是 Goertzel 算法,它利用了这样一个事实:在进行转换之前您知道自己关心的频率:http://en.wikipedia.org/wiki/Goertzel_algorithm

确实存在一些使用 Goertzel 检测 DTMF 的免费 python 代码,尽管我自己还没有尝试过,看一下:

http://johnetherton.com/projects/pys60-dtmf-detector

First you will need to decode the MP3 into an uncompressed format of raw samples at a given bit depth and sampling rate. Then you look for the frequencies that make up each DTMF tone. Though FFT can be used for this, the cannonical algorithm is The Goertzel Algorithm, which makes use of the fact that you know what frequencies you care about before doing the transformation: http://en.wikipedia.org/wiki/Goertzel_algorithm

There does exist some free python code for detecting DTMF using a Goertzel, though I haven't tried it myself, take a look at:

http://johnetherton.com/projects/pys60-dtmf-detector

情深如许 2024-09-13 04:02:25

对数据进行 FFT。您应该在两个音调的频率处得到尖峰。

Do an FFT on the data. You should get spikes at the frequencies of the two tones.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文