The Goertzel Algorithm is an optimized Discrete Fourier Transform (DFT) that can detect defined frequencies. It can be used e.g. to identify DTMF keys.
DTMF keys conist of 2 tones that can be described by the following diagram:
In the Arduino Audio Tools library we can use the GoertzelStream to build a simple DTMF detector.
Arduino Sketch
The example can be found in the examples and I was using an AI Thinker AudioKit for testing.
The sketch is basically just copying the audio from an configured AudioBoardStream to a configured Goertzerstream!
When defining a frequency, we can optionally pass an object. In my case I just use an instance to a DTMF class, which can be used to identify the row and colum id.
After identifying a row and a column, we just print out the corresponding character.
This is just a simple, minimal example, which can be easily extended to make it more reliable.
0 Comments