Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body Hi all, 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. This is the output of my C program which is attached: Crystal frequency: 4000000.00 Instruction cycles between samples: 278 Sampling frequency: 3597.12 Entries in sine table: 256 T0 T1 T2 T3 T4 T5 T6 T7 Tones 0 and 4: 14450 1371 810 1201 14981 1055 405 822 Tones 0 and 5: 13212 1627 1946 981 243 16503 715 516 Tones 0 and 6: 12650 2461 1156 351 957 5781 16911 1284 Tones 0 and 7: 12496 659 1574 743 177 867 1159 13150 Tones 1 and 4: 576 15003 2316 2349 13713 1143 1055 1128 Tones 1 and 5: 558 13071 1714 1093 507 19749 573 820 Tones 1 and 6: 1738 13829 1410 1041 769 1315 13499 1040 Tones 1 and 7: 2372 12375 934 529 1527 931 359 14726 Tones 2 and 4: 2764 961 17674 855 15585 1799 1109 488 Tones 2 and 5: 1904 467 15996 2085 2287 19371 1703 2152 Tones 2 and 6: 774 1135 18868 1667 2293 881 13693 1210 Tones 2 and 7: 1350 2643 16788 1467 841 1551 869 13496 Tones 3 and 4: 1318 413 1018 18973 15057 1365 4839 860 Tones 3 and 5: 246 2059 2242 18121 1213 17371 1491 872 Tones 3 and 6: 1054 663 1198 16785 937 645 14039 1444 Tones 3 and 7: 1340 2007 1568 17247 1639 963 1043 13312 Comments? Any problems with this approach? Do you think it will work in practise? Regards, Danjel McGougan Student at Linkoping Institute of Technology, Sweden. Content-type: text/plain; charset=US-ASCII Content-disposition: inline Content-description: Attachment information. The following section of this message contains a file attachment prepared for transmission using the Internet MIME message format. If you are using Pegasus Mail, or any another MIME-compliant system, you should be able to save it or view it from within your mailer. If you cannot, please ask your system administrator for assistance. ---- File information ----------- File: dft3.cpp Date: 25 Mar 1998, 20:31 Size: 3345 bytes. Type: Program-source Content-type: Application/Octet-stream; name="dft3.cpp"; type=Program-source Content-disposition: attachment; filename="dft3.cpp" Attachment converted: wonderland:dft3.cpp (????/----) (00015BBC)