> > 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.
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 _______________________________________________ Alsa-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-devel