Question

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?

Was it helpful?

Solution

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top