On Wed, 25 Mar 1998 20:49:05 +0000 Danjel McGougan >I've been thinking about DTMF detection in software using a PIC. >Has anyone tried to implement this using one bit samples and a DFT >calculation? > >I've implemented a little program in C to simulate the calculations >that could be performed by a PIC. The DFT routine is very simple to >implement because you don't need any multiplication when the samples >are only one bit. > >The DFT calculation is a bit simplified since it does not perform a >square and squareroot in the last addition. I use absolute values and >skip the root. This should work fine though. > >The results are pretty good. I was surprised to see that the DFT >calculated amplitude was about 5-10 times higher than other frequency >components with a noise amplitude that's half the DTMF tone >amplitude. Yes ! I did exactly this about a year ago. I initially did simulations in mathcad and then duplicated the results in quickbasic. I was also somewhat suprised by the peaks. I wrote up some code for a 16C84 and got it running in Parallax's PSIM. For the PIC simulation, a wrote another quickbasic program that generated the bit patterns I expected to capture for different DTMF characters and would then just hardcode the pattern into the PIC program. The simulations said it should work, but I was darned suprised that the first programmed chip actually did work ! I took 80 1-bit samples at around 4Khz. The PIC would transmit each DTMF character serially to a PC running any garden variety terminal program. The minor problem I had (on a 4Mhz 16C84 running at 3.58Mhz) was it took a little over 0.25 sec to actually decode a character and transmit it serially (at 9600 baud). I _could_ press buttons fast enough that it would miss characters. I only used about half the PICs program memory, but nearly all the RAM. I always meant to get a 10Mhz 16C84 and try it on it. About that time a got busy with other things and am JUST getting back into playing with the PICs (just a hobbiest). I would opt to go with a 16CF84 now, although my programmer doesn't support it without an upgrade :(. I also thought about using an FFT to speed things up, but that looked pretty hairy ! BTW, I graduated with a B.S. in electrical engineering about 10 years ago and learned more about the DFT on this project than I ever learned in college. Doug Boulware _____________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com Or call Juno at (800) 654-JUNO [654-5866]