DTMF detection from a wav file

孤人 提交于 2021-01-28 05:40:39

问题


I'm an engineering student and I have to solve an academic problem regarding signal processing.

Basically, given an DTMF signal in wav format, I have to identify the number sequence it has encoded. I must do so using discrete fourier transform analysis in Matlab environment, to build a script that reads the wav file and through the process identifies the numbers in the dial tone.

I'm having trouble in the sense that I'm not really confortable with the Matlab environment and the whole discrete fourier analysis is also very new to me, so I feel kinda lost.

Does anyone have some good tips or pointers that they can share?


回答1:


A DFT (or FFT) is overkill for DTMF detection. You just need 2 x 4 Goertzel filters for detecting the low and high tones. The output of each Goertzel filter will need to be low pass filtered to prevent detection of noise, but other than that it's pretty straightforward.

If use of DFT/FFT is mandatory then the general approach would be:

  • for each block of input samples
    • apply suitable window (e.g. Hanning)
    • perform DFT
    • calculate magnitude of each DFT bin (re*re+im*im)
    • measure magnitude at each of 8 bins which correspond to the 2 x 4 DTMF tones
    • if you have one high group tone and one low group tone which have significantly greater magnitude than the other tones in the group then a DTMF tone pair has been detected



回答2:


A magnitude DFT of real data is pretty much equivalent to N/2 orthogonal Goertzel filters of length N. And an FFT is just a fast DFT algorithm.

If you have to use an FFT because that's part of the specification, just pay attention to the FFT bins that correspond to the frequencies of the Goertzel filters needed to capture the required DTMF tones, and convert the complex result to magnitudes.

fft_bin_frequency = fft_bin_number * sample_rate / fft_length ;

Sanity check any suspected tone against the total FFT magnitude energy. If the ratio is "small", it might just be noise in the fft bin instead of a DTMF tone.



来源:https://stackoverflow.com/questions/6082347/dtmf-detection-from-a-wav-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!