DSPRelated.com
Forums

DTMF decoder

Started by ivan September 5, 2006

dbell wrote:

> Vladimir, > > We have not established that his tones must adhere to the standard at > this point.
This is not a random requirement. The purpose of the +/- 3% tolerance is to ensure that the tones are reliably distinguished from noise and interference in all reasonable conditions.
> If an algorithm is expecting samples at 8Ksps and I know I have 6Ksps, > there are adjustments I can make if I want the system to work (without > resampling).
Known constant error = no error.
> Similarly if I tape recorded the tones on a recorder with a 15% speed > error and played them back on a player that had no error, it does not > mean that I cannot recover the tones. >
Unknown variable error = unreliable result.
> Whether the tones need to adhere to the standard depends on the > application and the processing used to recover them.
It does not matter for the student coursework application :) Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Joerg,

What the constraints are is the question.  That is usually application
dependent.  Applications I have dealt with in the past (like the one
you commented on) are not usually a problem.  It depends what work you
are willing to do, and are capable of doing, or are allowed to do,
which is again application dependent.

Perhaps, the OP could let us know the application and source of error?

Dirk Bell
DSP Consultant

Joerg wrote:
> Hello Dirk, > > > > > Similarly if I tape recorded the tones on a recorder with a 15% speed > > error and played them back on a player that had no error, it does not > > mean that I cannot recover the tones. > > > > I often does. Unless you know the error prior to signal processing or > can be sure that all or at least most tones will occur and a nifty > algorithm can calculate the error from the ratios. > > -- > Regards, Joerg > > http://www.analogconsultants.com
Vladimir Vassilevsky wrote:
> dbell wrote: > > > Vladimir, > > > > We have not established that his tones must adhere to the standard at > > this point. > > This is not a random requirement. > The purpose of the +/- 3% tolerance is to ensure that the tones are > reliably distinguished from noise and interference in all reasonable > conditions.
I understand the purpose of the requirement. I also understand that there are applications where not meeting it does not mean you are rendered helpless.
> > > If an algorithm is expecting samples at 8Ksps and I know I have 6Ksps, > > there are adjustments I can make if I want the system to work (without > > resampling). > > Known constant error = no error.
Actually a huge error if not compensated for.
> > > Similarly if I tape recorded the tones on a recorder with a 15% speed > > error and played them back on a player that had no error, it does not > > mean that I cannot recover the tones. > > > > Unknown variable error = unreliable result.
Depends how variable, and over what period of time, and what else is present on the tape. Less reliable is also not always unusable.
> > > Whether the tones need to adhere to the standard depends on the > > application and the processing used to recover them. > > It does not matter for the student coursework application :)
If OP is a student, then he can give a more thorough answer. :) Dirk Bell DSP Consultant
> > Vladimir Vassilevsky > > DSP and Mixed Signal Design Consultant > > http://www.abvolt.com

CBFalconer wrote:


>>Goertzel algorithm is usually not the best way to do the DTMF >>decoding. The direct multiplication by sin/cos is simpler and >>better. > > > What is the Goertzel algorithm?
Just a "scientific name" for the 2nd order bandpass IIR. Then derive the signal amplitude from z1 and z2. > Where is it described? In the numerous application notes from AD, TI and the other DSP makers. All of the appnotes seem to be the retellings of the same original paper since they keep repeating the same misconceptions :)
> > Back about 1970 I designed a decoder that was highly noise immune, > and basically measured
periods between zero crossings, after a
> high/low band splitting filter.
This is neither simple no very robust way. A moderate frequency skew will fail it, unless you have a real good splitting filter. It also controlled the relative
> amplitudes of the high/low tones. I described it at an IEEE > meeting, and it was never patented [1].
A patent? Isn't it obvious to anyone who learned the basics? Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Vladimir Vassilevsky wrote:
> > > CBFalconer wrote: > > >>> Goertzel algorithm is usually not the best way to do the DTMF >>> decoding. The direct multiplication by sin/cos is simpler and >>> better. >> >> >> >> What is the Goertzel algorithm? > > > > Just a "scientific name" for the 2nd order bandpass IIR. Then derive the > signal amplitude from z1 and z2. > > > Where is it described? > > In the numerous application notes from AD, TI and the other DSP makers. > All of the appnotes seem to be the retellings of the same original paper > since they keep repeating the same misconceptions :) > >> >> Back about 1970 I designed a decoder that was highly noise >> immune, > and basically >> measured > > periods between zero crossings, after a > >> high/low band splitting filter. > > > This is neither simple no very robust way. A moderate frequency skew > will fail it, unless you have a real good splitting filter. > > It also controlled the relative > >> amplitudes of the high/low tones. I described it at an IEEE >> meeting, and it was never patented [1]. > > > A patent? Isn't it obvious to anyone who learned the basics?
It also sounds like the method used by all the early DTMF decoder ICs. Steve
Vladimir Vassilevsky wrote:
> CBFalconer wrote: >
... snip ...
>> >> Back about 1970 I designed a decoder that was highly noise immune, >> and basically measured periods between zero crossings, after a >> high/low band splitting filter. > > This is neither simple no very robust way. A moderate frequency skew > will fail it, unless you have a real good splitting filter. > >> It also controlled the relative >> amplitudes of the high/low tones. I described it at an IEEE >> meeting, and it was never patented [1]. > > A patent? Isn't it obvious to anyone who learned the basics?
Not in 1970. The only things available then were based on big iron cores and brute force narrow band filters. The things took about a 12 inch square card per channel, with about 1 inch clearance needed. My system was implementable with shift registers, which was the preferred mechanism for P-channel MOS custom ICs. And there was no frequency skew, since it was clocked from a crystal. The requirements for the band splitting filter were fairly moderate, and could be handled by a single dual op-amp. My system had better noise rejection than anything available then, and very positive signal acquisition in, IIRC, about 30 to 40 millisecs. Net expected space required was for three DIP packages, plus the odd resistor and capacitor. -- Chuck F (cbfalconer at maineline dot net) Available for consulting/temporary embedded and systems. <http://cbfalconer.home.att.net>
The source of error is the slowness of my ADC, at max speed (20MHz) it takes
5169 ck cycles in single shot conversion, hence I have to use it in
continious mode which takes 256 ck cycle for each conversion and at 8Ksps
this introduces an error of about 10%. But I have solved this problem
choosing a sampling rate that is dividable by the ADC freq:

20MHz/256/5 = 15625Ksps

because I need to sample a 2nd harmonic at 4600Hz (is for an automation
system that uses DTMF).... I might not have the processing power for this
though....

Can anyone tell me what this "direct moltiplication by sin/cos" Vladimir
told me is about? Google does not help on this.
I am new to dsp so I will appreciate any help on this

Thanks
ivan

"dbell" <bellda2005@cox.net> ha scritto nel messaggio
news:1157479549.914749.321750@i42g2000cwa.googlegroups.com...
> It would make a difference if it was a known constant error in sample > rate, which could be adjusted for. > > Also if the sample rate is essentially constant for a given phone call, > if you can detect (not decode) the presence of DTMF, you may be able to > estimate what the sample rate is from the tones received and then > adjust for it. > > What is the cause of the +-10%? > > Dirk Bell > DSP Constultant > > > ivan wrote: > > "ivan" <wolfsafety@wolfsafety.it> ha scritto nel messaggio > > news:edk1s6$pu6$1@news.flashnet.it... > > > Hi everyone, > > > > > > I am designing a dtmf decoder using the Goertzel algoritm, the problem
is
> > > that I have +/-5% error on my sampling rate timing. Does anyone know
if
> > this > > > is going to be a problem when calculating the results? > > > > > > > sorry error is +/-10% not 5 > > > > > Thanks in advance > > > ivan > > > > > > > > > >
> Can anyone tell me what this "direct moltiplication by sin/cos" > told me is about? > I am new to dsp
Not much fun doing a DTMF-decoder on a controller. a) One can use a bandsplitfilter seperating lowgroup and highgroup. Getting then the signal in both bands to 1 bit and deciding on the frequency is the easy part. Virtually all old SC-ICs like the MT8870 do it that way. The bandsplitfilter on a controller is difficult. TI has a applicationnote for the MSP430 using WDFs ( "wave digital filter" ). But getting WDFs up is a lot of work, i can scan one or more papers on DTMF bandsplits via WDF if you want to have a go at it ( Joerg has given up by now i guess ). b) One can use a filterbank with up to 16 narrow bandpass filters. * using IIRs out of the textbook is impractical. * Goertzel is the practical IIR-variant and for some controllers like the Mitsubishi M16 there are implementations. But usually it is limited to DSPs. * the "direct multiplication by sin/cos" looks roughly like that: http://www.embeddedforth.de/temp/dtmf2.pdf ( the text is in german and its not finished/working yet ) The "filter" is shown in picture 2: two multipliers, followed by 2 integrate & dump and the signal combined usually by an approximation ( http://www.embeddedforth.de/temp/quad.pdf ) This type of decoder was said to run on 4 MHz Z80 decades ago. But i have found it not that easy getting it up. c) A new idea using adaptive FIRs as notches looks intresting http://www.embeddedforth.de/temp/dtmf1.pdf Getting a notch with a FIR is simpler then getting a bandpass via IIR ( i.e. Goerzel ) d) there are lots of snakeoil ideas for "DTMF decoder on controller" published on the web or in old IEEE COM journals. Finally the real world: over which dynamic range is it supposed to work ? The old SC-ICs did 20dB, the better ones then ( "central office quality" ) and the new ones now 40dB. How long do you assume the signal is available: 40msec or 80msec ? 40msec is the spec but on real phonelines ( here in Germany at least ) 80msec will be available. Will you have dialtone on the line ? Is talk-off an issue ? Thats voicesignal that may trigger the DTMF-decoder. In version b) it might be easier to fix that then in a) and c). MfG JRD
Check a cheep DTMF decoder specification

http://www.holtek.com.tw/pdf/comm/9170v110.pdf


+- 1.5% accept

-+ 3.5% reject.


Note these holtek IC's should be very cheep in volume.

JG


"ivan" <wolfsafety@wolfsafety.it> wrote in message 
news:edk1s6$pu6$1@news.flashnet.it...
> Hi everyone, > > I am designing a dtmf decoder using the Goertzel algoritm, the problem is > that I have +/-5% error on my sampling rate timing. Does anyone know if > this > is going to be a problem when calculating the results? > > Thanks in advance > ivan > > >

ivan wrote:

> The source of error is the slowness of my ADC, at max speed (20MHz) it takes > 5169 ck cycles in single shot conversion, hence I have to use it in > continious mode which takes 256 ck cycle for each conversion and at 8Ksps > this introduces an error of about 10%.
That sounds odd to me. What is the hardware?
> But I have solved this problem > choosing a sampling rate that is dividable by the ADC freq: > > 20MHz/256/5 = 15625Ksps
The one bit quantization (comparator) is usually good enough to decode the DTMF. Especially if you put the simplest RC bandpass in the front of it.
> Can anyone tell me what this "direct moltiplication by sin/cos" Vladimir > told me is about? Google does not help on this.
Search for so-called "AON algorithm".
> I am new to dsp so I will appreciate any help on this
It is so simple. 1. Generate sin and cos of the target frequency. The simplest way is the table lookup. 2. Multiply sin and cos by your input. 3. Accumulate the products. 4. Find the amplitude from the products. Tip: sin and cos may be just a square wave. If the input is from the comparator, then the multiplication is a simple XOR operation. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com