> From: John Payson > > One approach I was considering for DTMF which would have been a little > tricky on the 16C71 [not quite as much RAM as I'd like] but should work > nicely on the '71A would be to use a "running-phase" counter which runs > from 0x0000-0x2FFF and do something like the following: [code deleted] > Fourteen cycles per frequency per sample to produce 3 buckets; the largest > absolute value among (Slot0+Slot1), (Slot1+Slot2), (Slot2-Slot0) will > correspond pretty well to the amount of energy at the desired frequency > (note: there will be a little bumpiness since your sampling points are > 60 degrees apart, and you will pick up some 5th and 7th harmonics though > this method will filter out the 2nd and 3rd and all multiples thereof. > Running this algorithm on a PC yielded pretty good results, and it would > seem it should run decently on a 16MHz PIC (looking for 8 tones, sampling > rate of about 8KHz). > > What do people think of this as an approach? > I may have missed something, but what is sampling at 6 points per cycle times 14 cycles gaining you over my approach of sampling at 4 points per cycle times 10 cycles? With DTMF, I wouldn't think that one would have to worry too much about picking up spurious harmonics, since the harmonics will not overlap until over the 4th harmonic which is high enough to be attenuated by the telecom network. Regards, SJH Canberra, Australia