DSPRelated.com
Forums

DTMF decoder

Started by ivan September 5, 2006

CBFalconer wrote:


>>>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.
I can't remember that. Perhaps, because I was one year old in 1970 :) Still the uA741 was already invented that time, right? The good narrowband filter could be built of the two lousy opamps. The other solution is the line of the synchronous detectors which should not be the problem at that time either. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com

Rafael Deliano wrote:


> Not much fun doing a DTMF-decoder on a controller. >
This is not a problem. The ATTiny26 running at 8MHz is sufficient to do the simultaneous independent DTMF transmit and receive processing, plus dialtones, plus a lot of the other functions. http://www.abvolt.com/products/telephone.htm BTW, the code is in C. No assembly at all :) Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Vladimir Vassilevsky wrote:

> dbell wrote:
>> 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.
It is not always necessary to be able to distinguish all tones. I have known the use of the NE567 PLL for detecting them, as well as a custom IC that uses a 3579545Hz crystal as its timing source. (At some point, the cheapest and most available crystal.) -- glen
"Vladimir Vassilevsky" <antispam_bogus@hotmail.com> ha scritto nel messaggio
news:FJALg.1901$MF1.410@newssvr25.news.prodigy.net...
> > > 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?
Zilog Z8Encore
> > > 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".
What does AON stand for?
> > > 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.
I will definetly try this...
> > Vladimir Vassilevsky > > DSP and Mixed Signal Design Consultant > > http://www.abvolt.com > > >

ivan wrote:


>>>But I have solved this problem >>>choosing a sampling rate that is dividable by the ADC freq: >>> >>>20MHz/256/5 = 15625Ksps
Your sample rate does not have to be at 8kHz. It does not matter what is the sample rate as long as is stable and high enough. You can adjust any algorithm for whatever sample rate.
>>Search for so-called "AON algorithm". > What does AON stand for?
The unofficial name for R 1.5 signaling. It is based on the dual tone sequences however it is absolutely different from the DTMF. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Hello Vladimir,

>>> >>>> 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. >
There was another way to do it but in telco this was not well understood: Mix up to a few ten kHz and filter there. Much easier. My favorite range was between 100kHz and 150kHz, mostly because it was pretty quiet from an EMI point of view (but that's a bit high for DTMF spacings). This wouldn't need 12" square in real estate.
> I can't remember that. Perhaps, because I was one year old in 1970 :) > Still the uA741 was already invented that time, right? > The good narrowband filter could be built of the two lousy opamps. > The other solution is the line of the synchronous detectors which should > not be the problem at that time either. >
Sure, I did it with uA709 in those days. But: Look at it from a manufacturer's point of view. In the 70's you could get 1% resistors but they cost much more than today. However, you could not buy 1% capacitors unless you paid a prohibitive price. 5% was available but still quite expensive. The standard was 10% to 20%. Not good enough and then you have to align, something that is not necessarily a good idea for DTMF detection gear. Then in the 80's switch-cap filter chips came. Unfortunately the mfgs kept their prices so high that engineers used them only if they absolutely had to. Consequently many these wonderful filter chips fell from grace and vanished :-( -- Regards, Joerg http://www.analogconsultants.com
Joerg said the following on 06/09/2006 23:58:
>>>>> 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. >> > > There was another way to do it but in telco this was not well > understood: Mix up to a few ten kHz and filter there. Much easier. My > favorite range was between 100kHz and 150kHz
How would that make things easier? Perhaps I'm missing something, but at 100kHz, wouldn't the filter order have to be absurdly high to separate tones only 250Hz apart? -- Oli
Hello Oli,


>>>>>> 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. >>> >> There was another way to do it but in telco this was not well >> understood: Mix up to a few ten kHz and filter there. Much easier. My >> favorite range was between 100kHz and 150kHz > > How would that make things easier? Perhaps I'm missing something, but > at 100kHz, wouldn't the filter order have to be absurdly high to > separate tones only 250Hz apart? >
Not really. You can create resonant circuits much easier. Another trick is to find an already existing filter that is cheap and widely available. At a few hundred kHz they would be pre-tuned LC, at several MHz it would be crystals, and at really high frequencies (tens of MHz) you'll find resonators. If you wanted to stick with only one filter frequency for all of them then each tone would get a synthesized oscillator and mixer. Sounds unorthodox and cumbersome but that can actually be made cheap and small. You just have to be aware of both upper and lower sideband to avoid ambiguity. Remember that this is now all old stuff. In those days we did not even have any decently priced micros. I have seen solutions with LC circuits at the audio level. Each inductor was huge and heavy (and expensive). That just didn't appeal to me ;-) BTW, there is another trick from the olden days to obtain a very narrow filter with a single LC circuit at a few hundred kHz: The Q-multiplier. Basically a stage that was broughht to a point just before oscillation. This "un-dampens" the LC circuit and you could peak the 6dB points of a 120kHz LC circuit to a few hundred Hertz. A really esoteric but very efficient filter in the 100kHz range was the mechanical filter. Those could also be found in communications equipment, for example from Collins (now Rockwell-Collins). -- Regards, Joerg http://www.analogconsultants.com
Joerg wrote:


(snip regarding DTMF decoders)

I remember that the original DTMF encoder (inside the phone)
used only one transistor for reliability reasons.  A complicated
set of switches and inductors to select the frequencies.

-- glen

> > 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.
Do you mean: a) 2 RC bandpass filters to separate the two groups of (high and low) frequency. b) Or maybe is enough to sample the wave as it comes in and the filter is used only for noise reduction. if (a) then how do you deal with speech-rejection? thanks ivan