On Sat, 19 Dec 1998, Dr. Imre Bartfai wrote: > Hi, > theoretically, there is another interesting approach: > one can build a Fourier spectrum analyser and then evaluate the power > spectra. In the Embedded Controller Handbook (AN's) there is one example > for 17C42. Such way, both dual-tone and single-tone can be reliable > detected... I did not tried it but maybe I will do it in the future... > Imre In theory there's not much difference between theory and practice; in practice though, there is... :) I would recommend against this method for two reasons: 1) FFT computation in real time for a pic sampling signals at a rate up to 3 or 4kHz is (extremely) difficult. Perhaps the hardware multiplier on the 17C core speeds things up quite a bit. However, I'd be really surprised if it was done (or doable). 2) One of the 'problems' with FFT's is that the frequency bins are evenly spaced. However, for DTMF signals they're logarithmically spaced. Ideally, you'd like the FFT bins to lie directly on top of the DTMF frequencies. At reasonable sample rates it's impossible to achieve this. Additionally, the FFT produces much more information than you need. You're really just interested in the magnitude of the DTMF tones and the total energy in the signal. The FFT decomposes the signal into many, many frequency bins. You may wish to look at Analog Devices' DSP apnotes. They discuss this more thoroughly. Their solution is to compute 16 DFT's: 8 at the DTMF tones and 8 at the 2nd harmonic of DTMF tones. The second set presumably allows one to ascertain whether a 'pure' DTMF tone was present or whether the DTMF energy is a harmonic of some lower frequency present signal. On comp.dsp I have read that people have found this technique to be flawed. But I haven't tried it my self (at least not as described here). Scott