enkitec@gmail.com wrote: > ; The eight possible tones used in DTMF are searched for one-by-one. I noticed this code was for a PIC 16, which doesn't have a multiplier, but I don't remember what PIC the OP is using. If the target PIC has a multiplier, then it will not be hard to search for all possible DTMF frequencies simultaneously. Basically multiply the incoming signal by the sine and cosine of each of the DTMF frequencies. Add the products for each frequency, then low pass filter those sums individually. The result will be the square of the voltage contribution of each of the frequencies. Since you're only trying to detect their presence, you can do the threshold comparison on the squared values just as well. Chose the filter characteristics such that 1394Hz (twice the lowest DTMF frequency of 697Hz, which is what you get due to squaring) is well attenuated, but so that it settles well enough within the 50mS minimum tone length window. For example, two poles with a filter fraction of 1/128 will settle to 90% in 500 samples, but the gain at 1394Hz assuming 100uS sample period is way under 1%. You want to sample around every 100uS, or every 1000 instructions on a PIC 18 running at 10MHz instruction rate. That leaves 125 instructions per tone per sample. That's certainly enough to do the calculations, but they will take a significant fraction of the processor cycles. Doing it on a dsPIC or its derivatives would be easier and would leave most of the processor for other things. ******************************************************************** Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products (978) 742-9014. Gold level PIC consultants since 2000. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist