dtmf

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
Post Reply
JKMADSCI
Posts: 17
Joined: Tue Nov 19, 2002 1:01 am
Location: QUEENS
Contact:

dtmf

Post by JKMADSCI » Thu Jul 22, 2004 8:59 pm

i am trying to decode dtmf signals using only a pic 16f684 and no other ic. Im able to decode what column the key was pressed in by counting th frequency.If anyone knows of some code (short)
to decode what row the key is in i would greatly appreciate the help

bodgy
Posts: 1044
Joined: Tue Dec 04, 2001 1:01 am
Location: Australia
Contact:

Re: dtmf

Post by bodgy » Thu Jul 22, 2004 9:32 pm

If you intend to do lots of pic'ing and want to lots of telephone type stuff, then have a look at the rat_ring group at yahoo. This group belongs to an ex BT engineer Ken Boakes, exists solely for pic to telephone interfacing.<p>Colin
On a clear disk you can seek forever.

cato
Posts: 366
Joined: Sun Sep 07, 2003 1:01 am
Contact:

Re: dtmf

Post by cato » Fri Jul 23, 2004 1:22 am

The DT in DTMF stands for Dual Tone. There are two frequencies in the tone. I'm wondering how you are detecting the one you are.... Anyway, the DUAL tones identify the exact key, (Thats how the phone company knows what number you're dialing), so, Identify the other tone and you're home free....<p>Now, how to do that? I'm not sure you can do the calculations in real time with a PIC, but a Fast Fourie (spelling?) Transform (FFT) or its close cousing (DFT?) should do that for you. They represent some pretty fancy math....but there are plenty of code fragments floating around...if you just wanna black box it .... and do a function call.<p>[ July 23, 2004: Message edited by: cato ]</p>

rshayes
Posts: 1286
Joined: Tue Mar 04, 2003 1:01 am
Contact:

Re: dtmf

Post by rshayes » Fri Jul 23, 2004 1:45 am

The tones are in two groups. The low frequency group has four frequencies, one for each row (697, 770, 852, and 941 Hz). The high frequency group has one frequency for each column (1209, 1336, 1477, and 1633 Hz). Only one frequency in each group is used at a time.<p>It should be possible to separate the two frequency groups using low-pass and high-pass filters. These would then be squared up and sent to the PIC as two logic signals. Software could then determine the frequency of each signal by measuring the period of each cycle.

JKMADSCI
Posts: 17
Joined: Tue Nov 19, 2002 1:01 am
Location: QUEENS
Contact:

Re: dtmf

Post by JKMADSCI » Fri Jul 23, 2004 1:19 pm

I appreciate the responses, but my personal requirements are 1. no external filters
2. no external ic
3. ive looked at that fourier
program and it is too complicated and way too long for my taste.
Ive wrote software in q basic to replicate the waves and using a simple peak counting algorithim
ive conquered the 3 columns in qbasic and on the pic. i just cant seem to pluck out the rows.
Ive tried using an algorithim that tracks zero crossing points and sub peaks, but all has failed. If anyone has any ideas or has seen a
short solution i would be gratfull

bodgy
Posts: 1044
Joined: Tue Dec 04, 2001 1:01 am
Location: Australia
Contact:

Re: dtmf

Post by bodgy » Fri Jul 23, 2004 4:15 pm

You could of course just purchase one of the cheap DTMF decoding chips and feed the output of that into the pic for further processing.<p>Have you looked at the ratring site, they have what you want in the files section.<p>Colin
On a clear disk you can seek forever.

User avatar
Chris Smith
Posts: 4325
Joined: Tue Dec 04, 2001 1:01 am
Location: Bieber Ca.

Re: dtmf

Post by Chris Smith » Fri Jul 23, 2004 8:43 pm

Incorporate the 567, costs a dime and does all the work for you.

cato
Posts: 366
Joined: Sun Sep 07, 2003 1:01 am
Contact:

Re: dtmf

Post by cato » Sat Jul 24, 2004 11:18 am

<blockquote><font size="1" face="Verdana, Helvetica, sans-serif">quote:</font><hr>Originally posted by JKMADSCI:
IIve wrote software in q basic to replicate the waves <hr></blockquote><p>I want to know more about what that means. Are you generating and adding together two sine waves? How? What update rate are you using? What does the output look like?

JKMADSCI
Posts: 17
Joined: Tue Nov 19, 2002 1:01 am
Location: QUEENS
Contact:

Re: dtmf

Post by JKMADSCI » Sun Jul 25, 2004 9:26 am

Hey cato i sent you a private message with more data. let me know if you got it?
[email protected]. Im new to this bb.

cato
Posts: 366
Joined: Sun Sep 07, 2003 1:01 am
Contact:

Re: dtmf

Post by cato » Sun Aug 01, 2004 6:06 am

I did get both of them. I'm not sure I fully understood the first one. And it has been far to long since i wrote code in Basic (and never in Qbasic) for me to understand the second one. However, one thing I THINK I got from the first one is that you say your algorithm works when you run it on one device, but not when you simulate it.... or something like that. What I don't see in either of your emails is any reference to sampling frequency. <p>My guess is that q basic is far too slow to catch all the zero crossings (or the peaks) with any reliablity. So, my guess is you are not catching the second frequency because you are sampling too slowly, and the code never sees the peaks you are looking for. <p>Additionally, its not clear to me, how, when you DO see a peak, you know which frequency component its associated with...

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests