Skip to contentSkip to conversation

DTMF recognition

DISCUSSION Philipp Vollmer 7 participants 7 messages Jul 25, 2002

lore
Share & tools
lore
#0 lore raw

Hello to all,

who has already done DTMF recognition with ALSA ( OSS )? I searched for examples in google, but I have found that only in TODO lists ;-(.

Is this so difficult or why doesn't exist anything about that?

regards

Philipp Vollmer

-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing real-time communications platform! Don't just IM. Build it in!
http://www.jabber.com/osdn/xim

#1 lore raw
Quoted 7 lines

Hello to all,

who has already done DTMF recognition with ALSA ( OSS )? I searched for examples in google, but I have found that only in TODO lists ;-(.

Is this so difficult or why doesn't exist anything about that?

its a relatively trivial FFT problem. use FFTW to analyse the signal, then look for two predominant frequencies, and check their values against a table.

believe it or not, there are many, many things that have never been written in the open source arena.

--p

-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing real-time communications platform! Don't just IM. Build it in!
http://www.jabber.com/osdn/xim

#2 lore raw

wouldn't it be easier to check for zerocrossings?

-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing real-time communications platform! Don't just IM. Build it in!
http://www.jabber.com/osdn/xim

#5 lore raw
In reply to Paul Davis
Quoted 5 lines · Paul Davis
Quoted 5 lines

who has already done DTMF recognition with ALSA ( OSS )? I searched for examples in google, but I have found that only in TODO lists ;-(.

Is this so difficult or why doesn't exist anything about that?

Please have a look at the isdn4linux code, either the kernel or one of the userland tools has very effective code to do that (no fft iirc).

Ciao
JÖrg
--
Joerg Mayer <[email protected]>
I found out that "pro" means "instead of" (as in proconsul). Now I know what proactive means.

-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing real-time communications platform! Don't just IM. Build it in!
http://www.jabber.com/osdn/xim

#3 lore raw
In reply to Maarten de Boer
Quoted 1 line

wouldn't it be easier to check for zerocrossings?

This would assume a perfect sine wave for both tones. The bad thing about zero crossing is that even the tiniest amount of noise completely ruins it, and then you're looking at second derivatives, which are also dependent upon signal quality. The great thing about dtmf, is you can find the signal even in truly bad cases.

An alternative to an fft is parallel resonant filters, but you cannot then check non-dtmf frequencies to avoid false triggering.

FFTW is the way to go.

Tony

-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing real-time communications platform! Don't just IM. Build it in!
http://www.jabber.com/osdn/xim

#6 lore raw
In reply to Paul Davis
Quoted 6 lines · Paul Davis
Quoted 6 lines

Hello to all,

who has already done DTMF recognition with ALSA ( OSS )? I searched for examples in google, but I have found that only in TODO lists ;-(.

Quoted 6 lines
Quoted 1 line

Is this so difficult or why doesn't exist anything about that?

its a relatively trivial FFT problem. use FFTW to analyse the signal, then look for two predominant frequencies, and check their values against a table.

This is hardly an ALSA problem... linux-audio-devel maybe?

I have some Matlab/Octave code to do this. I wrote it for a DSP class. I used the Goertzel algorithm. I could actually get pretty good rejection of false activation this way.

Email me if you want the code.

Regards,
Mark Rages
[email protected]

-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing real-time communications platform! Don't just IM. Build it in!
http://www.jabber.com/osdn/xim

#4 lore raw
In reply to Tony Hardie-Bick
Quoted 9 lines
Quoted 2 lines

wouldn't it be easier to check for zerocrossings?

This would assume a perfect sine wave for both tones. The bad thing about zero crossing is that even the tiniest amount of noise completely ruins it, and then you're looking at second derivatives, which are also dependent upon signal quality. The great thing about dtmf, is you can find the signal even in truly bad cases.

Quoted 4 lines

An alternative to an fft is parallel resonant filters, but you cannot then check non-dtmf frequencies to avoid false triggering.

FFTW is the way to go.

I'm an engineer and such a problem had been a standard case for our studies. In DTMF, you only want to check for a specific set of frequencies. Say you have a signal 'f(t)', where t is the time. A frequency (tone) is a signal in the form of 'sin(a*t)'. To detect that tone, you only need to check g(t) = f(t) * sin(a*t)
this is what fft does, but fft will do that for a very wide range of frequencies. Read any engineering maths, and you may find a good way of checking a signal against some known frequency.
Don't rely on zerocrossings, phase difference may ruin the results. The correlation (that's its name; the multiplication I explained) stuff has amazingly good results..

-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing real-time communications platform! Don't just IM. Build it in!
http://www.jabber.com/osdn/xim