On Tue, 29 Jul 2003, Dale Shelor wrote: > Hello, > > What I'm looking to do is decode (or detect the present of) a sub audible > audio tone using a PIC. The tones are received on a radio receiver and > range from 67.0Hz to 254.1Hz. Accuracy needs to be around -+1%. Faster > the better! False triggers are acceptable but need to be minimal. Anyone > ever done this or have tips on how to accomplish this? I'm using CCS C but > can always snip in ASM code. Code samples would be great! > > GE did this with an Intel 8049 at 6MHz, surely it can be done with a PIC > 16F877 at 20MHz! GE used a low pass filter to filter out all audio above > 300Hz, then sent the low frequency audio into the CPU and decoded the > tones. GE did this very fast and accurate. If you can use an analog filter to remove the high frequencies then it's fairly straight forward to perform tone decoding with a PIC. For a theoretical background, checkout: http://www.dattalo.com/technical/theory/dtmf.html I've used the techniques described there to decode DTMF and CAS tones. Your frequencies are an order of magnitude smaller and consequently much easier to decode. OTOH, DTMF consists of only 16 tones. You want much finer resolution. It's possible to construct filter banks to improve the resolution. For example, you can create binary banks that filter into high and low frequencies. The filter that produces the stronger signal is further subdivided and searched. After 7 levels, you'll resolve to 1 part out of 128. This technique only works if there really is just one tone present. Another approach is to break your frequency range into more than 2 banks. For example, you could pick 8 banks, determine which has the strongest signal and then further subdivide that bank; etc. However, from a computational point of view it amounts to about the same work. When your dealing with two frequencies at once, you can resolve them much more quickly/accurately than when you attempt to resolve 8 frequencies at once. Scott -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body