- Goertzel algorithm
The Goertzel algorithm is a
digital signal processing(DSP) technique for identifying frequencycomponents of a signal, published by Dr. Gerald Goertzel in 1958. While the general Fast Fourier transform(FFT) algorithm computes evenly across the bandwidth of the incoming signal, the Goertzel algorithm looks at specific, predetermined frequency.
A practical application of this algorithm is recognition of the tones produced by the buttons pushed on a telephone keypad. This application is illustrated by the below 'C' programming language implementation of the algorithm, demonstrating the production of a
Explanation of algorithm
The Goertzel algorithm computes a sequence, , given an input sequence, ::where and is some frequency of interest, in cycles per sample, which should be less than 1/2. This effectively implements a second-order
IIRfilter with poles at and , and requires only one multiplication (assuming is pre-computed), one addition and one subtraction per input sample. For real inputs, these operations are real.
Z transformof this process is:Applying an additional, FIR, transform of the form:will give an overall transform of:The time-domain equivalent of this overall transform is:which becomes, assuming for all :
or, the equation for the -sample DFT of , evaluated for and multiplied by the scale factor .
Note that applying the additional transform Y(z)/S(z) only requires the last two samples of the sequence. Consequently, upon processing samples , the last two samples from the sequence can be used to compute the value of a DFT bin which corresponds to the chosen frequency as:For the special case often found when computing DFT bins, where for some integer, , this simplifies to:In either case, the corresponding power can be computed using the same cosine term required to compute as:
When implemented in a general-purpose processor, values for and can be retained in variables and new values of can be shifted through as they are computed, assuming that only the final two values of the sequence are required. The code may then be as follows:s_prev = 0s_prev2 = 0coeff = 2*cos(2*PI*normalized_frequency);for each sample, x [n] , s = x [n] + coeff*s_prev - s_prev2; s_prev2 = s_prev; s_prev = s;endpower = s_prev2*s_prev2 + s_prev*s_prev - coeff*s_prev2*s_prev;
In order to compute a single DFT bin for a complex sequence of length "N", this algorithm requires 2"N" multiplies and 4"N" add/subtract operations within the loop, as well as 4 multiplies and 4 add/subtract operations to compute , for a total of 2"N"+4 multiplies and 4"N"+4 add/subtract operations (for real sequences, the required operations are half that amount). In contrast, the
Fast Fourier transform(FFT) requires 2log2"N" multiplies and 3log2"N" add/subtract operations per DFT bin, but must compute all "N" bins simultaneously (similar optimizations are available to halve the number of operations in an FFT when the input sequence is real).
When the number of desired DFT bins, "M", is small (e.g., when detecting
DTMFtones), it is computationally advantageous to implement the Goertzel algorithm, rather than the FFT. Approximately, this occurs when:or if, for some reason, "N" is not an integral power of 2 while you stick to a simple FFT algorithm like the 2-radix Cooley-Tukey FFT algorithm, and zero-padding the samples out to an integral power of 2 would violate:Moreover, the Goertzel algorithm can be computed as samples come in, and the FFT algorithm may require a large table of "N" pre-computed sines and cosines in order to be efficient.
If multiplications are not considered as difficult as additions, or vice versa, the 5/6 ratio can shift between anything from 3/4 (additions dominate) to 1/1 (multiplications dominate).
DTMFor Dual-Tone Multi Frequency is the official name of the tones generated from a telephone keypad. (AT&T used the trademark "Touch-Tone" for its DTMF dialing service. [http://tarr.uspto.gov/servlet/tarr?regser=serial&entry=72109459 USPTO trademark entry for Touch-Tone] , retrieved on March 29, 2007.] ) The original keypads were mechanical switches triggering RC controlled oscillators.Fact|date=February 2007 The digit detectors were also tuned circuits. The interest in decoding DTMF is high because of the large numbers of phones generating these types of tones.
At present, DTMF detectors are most often implemented as numerical algorithms on either general purpose computers or on fast digital signal processors. The algorithm shown below is an example of such a detector.
However, this algorithm needs an additional post-processing step to completely implement a functional DTMF tone detector. DTMF tone bursts can be as short as 50 milli-seconds or as long as several seconds. The tone burst can have noise or dropouts within it which must be ignored. The Goertzel algorithm produces multiple outputs; a post-processing step needs to smooth these outputs into one output per tone burst.
One additional problem is that the algorithm will sometimes produce spurious outputs because of a window period that is not completely filled with samples. Imagine a DTMF tone burst and then imagine the window superimposed over this tone burst. Obviously, the detector is running at a fixed rate and the tone burst is not guaranteed to arrive aligned with the timing of the detector. So some window intervals on the leading and trailing edges of the tone burst will not be entirely filled with valid tone samples. Worse, RC-based tone generators will often have voltage sag/surge related anomalies at the leading and trailing edges of the tone burst. These also can contribute to spurious outputs.
It is highly likely that this detector will report false or incorrect results at the leading and trailing edges of the tone burst due to a lack of sufficient valid samples within the window. In addition, the tone detector must be able to tolerate tone dropouts within the tone burst and these can produce additional false reports due to the same windowing effects.
The post-processing system can be implemented as a statistical aggregator which will examine a series of outputs of the algorithm below. There should be a counter for each possible output. These all start out at zero. The detector starts producing outputs and depending on the output, the appropriate counter is incremented. Finally, the detector stops generating outputs for long enough that the tone burst can be considered to be over. The counter with the highest value wins and should be considered to be the DTMF digit signaled by the tone burst.
While it is true that there are eight possible frequencies in a DTMF tone, the algorithm as originally entered on this page was computing a few more frequencies so as to help reject false tones (talkoff). Notice the peak tone counter loop. This checks to see that only two tones are active. If more than this are found then the tone is rejected.
Sample code for a DTMF detector
* [http://www.dattalo.com/technical/theory/dtmf.html DTMF decoding with a 1-bit A/D converter]
* [http://www.ti.com/sc/docs/psheets/abstract/apps/spra066.htm Modified Goertzel Algorithm in DTMF Detection Using the TMS320C80 DSP]
* [http://focus.ti.com/lit/an/spra096a/spra096a.pdf DTMF Tone Generation and Detection: An Implementation Using the TMS320C54x]
* [http://focus.ti.com/lit/an/spra168/spra168.pdf Mock, P., Add DTMF Generation and Decoding to DSP-μP Designs, EDN, March 21, 1985, also DSP Applications with the TMS320 Family, Vol. 1, Texas Instruments, 1989.]
Wikimedia Foundation. 2010.
Look at other dictionaries:
Goertzel-Algorithmus — Der Goertzel Algorithmus ist ein Verfahren aus der digitalen Signalverarbeitung und stellt eine besondere Form der diskreten Fourier Transformation (DFT) dar. Im Gegensatz zu den verschiedenen schnellen Berechnungsmethoden bei der diskreten… … Deutsch Wikipedia
Алгоритм Гёрцеля — (англ. Goertzel algorithm) это специальная реализация дискретного преобразования Фурье (ДПФ) в форме рекурсивного фильтра. Данный алгоритм был предложен Джеральдом Гёрцелем в 1958 году. В отличие от быстрого преобразования Фурье,… … Википедия
List of algorithms — The following is a list of the algorithms described in Wikipedia. See also the list of data structures, list of algorithm general topics and list of terms relating to algorithms and data structures.If you intend to describe a new algorithm,… … Wikipedia
List of numerical analysis topics — This is a list of numerical analysis topics, by Wikipedia page. Contents 1 General 2 Error 3 Elementary and special functions 4 Numerical linear algebra … Wikipedia
List of mathematics articles (G) — NOTOC G G₂ G delta space G networks Gδ set G structure G test G127 G2 manifold G2 structure Gabor atom Gabor filter Gabor transform Gabor Wigner transform Gabow s algorithm Gabriel graph Gabriel s Horn Gain graph Gain group Galerkin method… … Wikipedia
Dual-tone multi-frequency — (DTMF) signaling is used for telephone signaling over the line in the voice frequency band to the call switching center. The version of DTMF used for telephone tone dialing is known by the trademarked term Touch Tone (canceled March 13, 1984),… … Wikipedia
Dual-tone multi-frequency signaling — One of the few production telephone DTMF keypads with all 16 keys, from an Autovon Telephone. The column of red keys produces the A, B, C, and D DTMF events. Dual tone multi frequency signaling (DTMF) is used for telecommunication signaling over… … Wikipedia
Digital signal processing — (DSP) is concerned with the representation of discrete time signals by a sequence of numbers or symbols and the processing of these signals. Digital signal processing and analog signal processing are subfields of signal processing. DSP includes… … Wikipedia
Multi-frequency receiver — Multi Frequency signalling, (MF), is similar to the European version, CCITT Signaling System 5, (SS5). The original format was five tones used in pairs. This later evolved to six tones. Because its six tones are used only in pairs, this signaling … Wikipedia
Friendly artificial intelligence — Laws of robotics Three Laws of Robotics by Isaac Asimov (in culture) · Tilden s Laws of Robotics by Mark Tilden … Wikipedia