Forums

Goertzel to recognize DTMF in Java

Started by Unknown November 29, 2004
Hello,

Im working on the recognition, from a wav file, of DTMF tones. The
program is being done in Java. What i do is open the file, get the info
in a byte array and pass it to a double array. Now im not sure what to
do.  Ive heard that the best algorithm for this task is Goertzel, but I
havent been able to find information that works for me.

Has anybody tried this before, does it work?
Information will be greatly appreciated!

Thanks,
Dan

bmobananas@yahoo.com wrote:
> Ive heard that the best algorithm for this task is Goertzel, but I > havent been able to find information that works for me. > > Has anybody tried this before,
Yes.
> does it work?
Yes.
> Information will be greatly appreciated!
Can you describe why the information you found doesn't "work" for you? -- Jim Thomas Principal Applications Engineer Bittware, Inc jthomas@bittware.com http://www.bittware.com (603) 226-0404 x536 Visualize whirled peas.
Google "Goertzel Algorithm" and you'll get the same information
cheaper.  DTMF stuff is probably the most applied case study for the
Goertzel Algorithm.

I've used the Goertzel algorithm on a number of occasions and it works
as advertised.  It's a way to form a bin computation of the DFT as a
linear filter operation.  My reference has been Proakis & Manolakis,
3rd Edition, pp480-481.  (Discrete Signal Processing (Principles,
Algorithms, and Applications).

  Jake



bmobananas@yahoo.com wrote in message news:<1101710189.290340.167710@f14g2000cwb.googlegroups.com>...
> Hello, > > Im working on the recognition, from a wav file, of DTMF tones. The > program is being done in Java. What i do is open the file, get the info > in a byte array and pass it to a double array. Now im not sure what to > do. Ive heard that the best algorithm for this task is Goertzel, but I > havent been able to find information that works for me. > > Has anybody tried this before, does it work? > Information will be greatly appreciated! > > Thanks, > Dan
Hi Dan

> Im working on the recognition, from a wav file, of DTMF tones. The > program is being done in Java. What i do is open the file, get the info > in a byte array and pass it to a double array. Now im not sure what to > do. Ive heard that the best algorithm for this task is Goertzel, but I > havent been able to find information that works for me.
I don't know if this is any good to you, but coincidentally very recently I wrote a DTMF decoder in C for Windows that takes WAV format input from a soundcard in real time, and decode it for use with a simple satellite telemetry downlink that transmits if the satellite's on board computer is not functioning. I did not use the Goertzel algorithm (I wasn't aware of it until now) that looks at second harmonics of the base DTMF tones. I found some other references and source code, but in general I found them to be rather bad at decoding with many falsings. The algorithm I use only looks at the fundamentals, although to avoid falsing it takes two successive (but not interleaved) samples. It also uses a dynamic AGC so that it works in a noisy FM channel without squelch. The FFT is based on some old DOS code that I ported to Windows. As this is fairly young code, it's still evolving, but it does work pretty well as it stands. Possible changes will include interleaved sampling in order to take advantage of the samples at the beginning and end of the Hamming window. There is some other stuff in there applicable to the telemetry that of course won't be of particular interest to you! http://www.g6lvb.com/dtmffft.zip Kind Regards, Howard
On 29 Nov 2004 06:57:19 -0800, jakespambox@yahoo.com (Jake Janovetz)
wrote:

>Google "Goertzel Algorithm" and you'll get the same information >cheaper. DTMF stuff is probably the most applied case study for the >Goertzel Algorithm. > >I've used the Goertzel algorithm on a number of occasions and it works >as advertised. It's a way to form a bin computation of the DFT as a >linear filter operation. My reference has been Proakis & Manolakis, >3rd Edition, pp480-481. (Discrete Signal Processing (Principles, >Algorithms, and Applications). > > Jake
Hi, just to add my two cents, as far as I an tell the feed forward coefficient in Figure 6.17 is not correct. The WkN factor in Eq. (6.3.9) looks correct. [-Rick-]
Howard Long wrote:
> Hi Dan > > >>Im working on the recognition, from a wav file, of DTMF tones. The >>program is being done in Java. What i do is open the file, get the info >>in a byte array and pass it to a double array. Now im not sure what to >>do. Ive heard that the best algorithm for this task is Goertzel, but I >>havent been able to find information that works for me. > > > I don't know if this is any good to you, but coincidentally very recently I > wrote a DTMF decoder in C for Windows that takes WAV format input from a > soundcard in real time, and decode it for use with a simple satellite > telemetry downlink that transmits if the satellite's on board computer is > not functioning. > > I did not use the Goertzel algorithm (I wasn't aware of it until now) that > looks at second harmonics of the base DTMF tones. > > I found some other references and source code, but in general I found them > to be rather bad at decoding with many falsings. > > The algorithm I use only looks at the fundamentals, although to avoid > falsing it takes two successive (but not interleaved) samples. It also uses > a dynamic AGC so that it works in a noisy FM channel without squelch. > > The FFT is based on some old DOS code that I ported to Windows. > > As this is fairly young code, it's still evolving, but it does work pretty > well as it stands. Possible changes will include interleaved sampling in > order to take advantage of the samples at the beginning and end of the > Hamming window. > > There is some other stuff in there applicable to the telemetry that of > course won't be of particular interest to you! > > http://www.g6lvb.com/dtmffft.zip > > Kind Regards, Howard
The DTMF decoder in the spandsp library at ftp://ftp.opencall.org/pub achieves a very low false hit rate on the bellcore test tapes. The test suite for it is pretty close to being what you need to decode wave files. The bellcore data I use has been transcribed to wave files. The last part of the test suite reads through those wave files looking for false hits. Change that to just report the hits from a wave file, and you should be done (assuming your wave file is sampled at 8000 samples/second). Regards, Steve