DTMF decoder

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

Reply to
ivan
Loading thread data ...

"ivan" ha scritto nel messaggio news:edk1s6$pu6$ snipped-for-privacy@news.flashnet.it...

this

sorry error is +/-10% not 5

Reply to
ivan

Goertzel algorithm is usually not the best way to do the DTMF decoding. The direct multiplication by sin/cos is simpler and better.

the problem is

This is not going to work at all, since the DTMF frequencies are spaced only about 10% from one to another. For the proper operation, you need the accuracy of 1% or better.

Vladimir Vassilevsky

DSP and Mixed Signal Design Consultant

formatting link

Reply to
Vladimir Vassilevsky

"Vladimir Vassilevsky" ha scritto nel messaggio news:kngLg.15510$% snipped-for-privacy@newssvr29.news.prodigy.net...

Do you know any link or resource I can look about this?

Reply to
ivan

Hello Ivan,

The error rate directly affects how far off the detection will be. I do not believe you can tolerate 5% for DTMF.

TI app note slaae16.htm talks a bit about DTMF decoding (and encoding). But best would be to obtain a copy of the "official" DTMF specs.

--
Regards, Joerg

http://www.analogconsultants.com
Reply to
Joerg

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:

Reply to
dbell

No.

  1. The 10% is as big as the spacing between the adjacent DTMF tones.
  2. According to the standard, the DTMF decoder should ignore any frequencies outside the tolerance of +/- 3%.

The RC oscillator clocked MCU, perhaps.

Vladimir Vassilevsky

DSP and Mixed Signal Design Consultant

formatting link

Reply to
Vladimir Vassilevsky

Vladimir,

We have not established that his tones must adhere to the standard at this point.

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).

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.

Whether the tones need to adhere to the standard depends on the application and the processing used to recover them.

Dirk Bell DSP C> dbell wrote:

Reply to
dbell

Hello Dirk,

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
Reply to
Joerg

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.

Known constant error = no error.

Unknown variable error = unreliable result.

It does not matter for the student coursework application :)

Vladimir Vassilevsky

DSP and Mixed Signal Design Consultant

formatting link

Reply to
Vladimir Vassilevsky

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 C> Hello Dirk,

Reply to
dbell

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.

Actually a huge error if not compensated for.

Depends how variable, and over what period of time, and what else is present on the tape. Less reliable is also not always unusable.

If OP is a student, then he can give a more thorough answer. :)

Dirk Bell DSP Consultant

Reply to
dbell

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" ha scritto nel messaggio news: snipped-for-privacy@i42g2000cwa.googlegroups.com...

is

if

Reply to
ivan

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:

formatting link
( 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 (
formatting link
) 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
formatting link
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

Reply to
Rafael Deliano

Check a cheep DTMF decoder specification

formatting link

+- 1.5% accept

-+ 3.5% reject.

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

JG

Reply to
Joe G (Home)

That sounds odd to me. What is the hardware?

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.

Search for so-called "AON algorithm".

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

formatting link

Reply to
Vladimir Vassilevsky

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.

formatting link

BTW, the code is in C. No assembly at all :)

Vladimir Vassilevsky

DSP and Mixed Signal Design Consultant

formatting link

Reply to
Vladimir Vassilevsky

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

Reply to
glen herrmannsfeldt

"Vladimir Vassilevsky" ha scritto nel messaggio news:FJALg.1901$ snipped-for-privacy@newssvr25.news.prodigy.net...

takes

8Ksps

Zilog Z8Encore

it.

What does AON stand for?

I will definetly try this...

Reply to
ivan

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.

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

formatting link

Reply to
Vladimir Vassilevsky

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.