DSPRelated.com
Forums

DTMF Detection

Started by Shehryar Amir February 16, 2002

Dear All,

I am new to this group. I want to implement DTMF Detection algorithm in
C/C++. I have read some material on web and have chosen to start with
NonUniform Discrete Fourier Transform i:e Goertzel Algoritm. How can I meet
the ITU-T specifiaction ? How can I choose a suitable value of N that meets
both Signal Duration and Frequency Tolerance.?

Regards

Sheheyr




Hi Shehryar,

The choice of N is mainly driven by the frequency resolution needed, which
sets
a lower boundary. N also is chosen so that (k/N)fs most accurately coincides
with the actual DTMF frequencies assuming k are integer values and fs is a
sampling frequency of 8 ksps.

The DTMF detection procedure is usually done (as you have chosen) by using
the classical Goertzel algorithm, and sends detected digit to the master
CPU. It works on an 8 kHz, 8 samples current received frame.
The detection itself is done by calling two procedures, as a working (very
well) example :
* goertzel() executes 16 Goertzel algorithms to detect the 8 DTMF
frequencies and their second harmonics. This procedure must be called XXX
consecutive times, i.e. detection is done with an equivalent DFT order = XXX
* frame duration = N samples. This function also includes a gain control
function to protect accumulators from overflow.
* dtmfchecks() analyses the results of the Goertzel algorithms. Once
the spectral information (squared magnitude for the row and column
frequencies and their second harmonics) is collected, a series of tests need
to be executed to determine the validity of tone and digit results. A first
check makes sure the signal strength of the possible DTMF tone pair is
sufficient. The sum of the squared magnitudes of the peak spectral row
component and the peak spectral column component needs to be above a certain
threshold. Tone twists are investigated in a separate check to make sure the
twist ratio specifications are met. The spectral information can reflect the
types of twists. The more likely one, called "reverse twist", assumes the
row peak to be larger than the column peak. The detector, therefore,
computes a reverse twist ratio and checks if it is above a threshold. The
other twist, called "standard twist", occurs when the row peak is smaller
than the column peak. Similarly, a "standard twist ratio" is computed and
its threshold checked. The program makes a comparison of spectral components
within the row group as well as within the column group. The strongest
component must stand out (in terms of squared amplitude) from its proximity
tones within its group by more than a certain threshold ratio. Finally, the
program checks on the strength of the second harmonics in order to be able
to discriminate DTMF tones from possible speech or music. This second
harmonics check makes sure that the ratio of the second harmonics component
and the fundamental frequency component is below a certain threshold. If the
DTMF signal pair passes all these checks, we say a valid tone pair, which
corresponds to a digit, is present. Then, the tone-pair is mapped to its
corresponding digit and comparing it with the previously detected digit.
Only if the last digit was preceded by a pause do we accept the current
digit as a valid digit. The detector is then forced into a state where it
waits for a pause (no signal) before being able to accept a new digit. This
last step is necessary to ensure the discrimination of identical keystrokes
succeeding one another.

As you understood, you can perfectly meet the ITU-T specification by doing
more than one DFT
for a same digit detection) + waiting for the necessary time before
indicating any detection.

Hope that helps.
Regards,
Franck Hocquet
Field Application Engineer
EBV ELEKTRONIK , Paris
-----Original Message-----
From: Shehryar Amir [mailto:]
Sent: samedi 16 frier 2002 13:51
To: ;
Subject: [speechcoding] DTMF Detection
Dear All,

I am new to this group. I want to implement DTMF Detection algorithm in
C/C++. I have read some material on web and have chosen to start with
NonUniform Discrete Fourier Transform i:e Goertzel Algoritm. How can I meet
the ITU-T specifiaction ? How can I choose a suitable value of N that meets
both Signal Duration and Frequency Tolerance.?

Regards

Sheheyr _____________________________________
Note: If you do a simple "reply" with your email client, only the author of
this message will receive your answer. You need to do a "reply all" if you
want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:

To Post:

To Leave:

Archives: http://www.yahoogroups.com/group/speechcoding

Other DSP-Related Groups: http://www.dsprelated.com ">http://docs.yahoo.com/info/terms/


Hi Shahryar
Go to www.programmersheaven.com
Regards
Shahram

--- Shehryar Amir <> wrote:
>
> Dear All,
>
> I am new to this group. I want to implement DTMF
> Detection algorithm in
> C/C++. I have read some material on web and have
> chosen to start with
> NonUniform Discrete Fourier Transform i:e Goertzel
> Algoritm. How can I meet
> the ITU-T specifiaction ? How can I choose a
> suitable value of N that meets
> both Signal Duration and Frequency Tolerance.?
>
> Regards
>
> Sheheyr >
>


__________________________________________________


Hi Shehryar,

U can have a look at the application report numbered SPRA168, at www.ti.com

Hope U find that useful.

Regards,
Twafik Mohamed,P.
Design Engineer
DSP Group
RealChip
161, Greams Road
Thousand Lights, Chennai - 600 006
Phone:91 44 8290919,8292689 Extn:209
Emails:,

-----Original Message-----
From: Shehryar Amir [mailto:]
Sent: Saturday, February 16, 2002 6:21 PM
To: ;
Subject: [speechcoding] DTMF Detection
Dear All,

I am new to this group. I want to implement DTMF Detection algorithm in
C/C++. I have read some material on web and have chosen to start with
NonUniform Discrete Fourier Transform i:e Goertzel Algoritm. How can I meet
the ITU-T specifiaction ? How can I choose a suitable value of N that meets
both Signal Duration and Frequency Tolerance.?

Regards

Sheheyr _____________________________________
Note: If you do a simple "reply" with your email client, only the author of
this message will receive your answer. You need to do a "reply all" if you
want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:

To Post:

To Leave:

Archives: http://www.yahoogroups.com/group/speechcoding

Other DSP-Related Groups: http://www.dsprelated.com ">http://docs.yahoo.com/info/terms/