Search code examples
matlabsignal-processingfftdtmf

DTMF detection from a wav file


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?


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