---
title: Dual-Tone Multi-Frequency (DTMF) Decoding with the Goertzel Algorithm in Java
canonical: https://0110.be/posts/Dual-Tone_Multi-Frequency_%28DTMF%29_Decoding_with_the_Goertzel_Algorithm_in_Java
markdown_url: https://0110.be/posts/Dual-Tone_Multi-Frequency_%28DTMF%29_Decoding_with_the_Goertzel_Algorithm_in_Java.md
id: 343
published_at: '2011-09-27T09:07:26Z'
updated_at: '2013-12-05T18:19:15Z'
author: Joren
tags:
- name: Code
  markdown_url: https://0110.be/tags/Code.md
- name: HoGent
  markdown_url: https://0110.be/tags/HoGent.md
- name: Java
  markdown_url: https://0110.be/tags/Java.md
- name: TarsosDSP
  markdown_url: https://0110.be/tags/TarsosDSP.md
---

# Dual-Tone Multi-Frequency (DTMF) Decoding with the Goertzel Algorithm in Java

<a href="https://0110.be/files/attachments/343/GoertzelDTMF.jar"><img style="float:right;margin-left:5px" src="https://0110.be/files/attachments/343/goertzel_DTMF_java_7.png" alt="DTMF Goertzel in JAVA"/></a>The DSP library of Tarsos, aptly named TarsosDSP, now contains an implementation of the Goertzel Algorithm. It is implemented using pure Java.

The [Goertzel algorithm](http://en.wikipedia.org/wiki/Goertzel_algorithm) can be used to detect if one or more predefined frequencies are present in a signal and it does this very efficiently. One of the classic applications of the Goertzel algorithm is decoding the tones generated on by touch tone telephones. These use [DTMF (Dual tone multi frequency)-signaling](http://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling).

To make the algorithm visually appealing a Java Swing interface has been created(visible right). You can try this application by running the "Goertzel DTMF Jar-file":\[GoertzelDTMF.jar\]. The souce code is included in the jar and is avaliable as a separate "zip file":\[GoertzelDTMF_src.zip\]. The [TarsosDSP github page](https://github.com/JorenSix/TarsosDSP) also contains the source for the [Goertzel algorithm Java implementation](https://github.com/JorenSix/TarsosDSP/blob/master/src/be/hogent/tarsos/dsp/pitch/Goertzel.java).


![DTMF detection of 9](https://0110.be/files/photos/343/goertzel_DTMF_java_9.png)

![DTMF detection of 2](https://0110.be/files/photos/343/goertzel_DTMF_java_2.png)

- [goertzel\_DTMF\_java\_7.png](https://0110.be/files/attachments/343/goertzel_DTMF_java_7.png)

- [GoertzelDTMF.jar](https://0110.be/files/attachments/343/GoertzelDTMF.jar)

- [GoertzelDTMF\_src.zip](https://0110.be/files/attachments/343/GoertzelDTMF_src.zip)
