2 #This is sample implementation of DTMF decoder using my C implementation of Goertzel Algorithm
3 #This is not very efficient or precise, it's just proof of concept
4 #Note that it's also quite tricky (but not imposible) to detect DTMF using microphone
5 #You will probably need to tune treshold and mixer settings a bit...
6 #I've had best results using dtmfdial (Linux software) and two soundcards connected directly using cable
7 #Usage example: arecord 2>/dev/null | ./dtmf.sh
11 .
/goertzel
-n B
-q -l c
-r 8000 -d 20 -t $tresh -f 697 -f 770 -f 852 -f 941 -f 1209 -f 1336 -f 1477 -f 1633 $@ |
while read line
; do
15 pos
="$(echo "$line" | cut -f 1)";
17 #Get values for each tone
18 a
="$(echo "$line" | cut -f 2)";
19 b
="$(echo "$line" | cut -f 3)";
20 c
="$(echo "$line" | cut -f 4)";
21 d
="$(echo "$line" | cut -f 5)";
22 e
="$(echo "$line" | cut -f 6)";
23 f
="$(echo "$line" | cut -f 7)";
24 g
="$(echo "$line" | cut -f 8)";
25 h
="$(echo "$line" | cut -f 9)";
27 #echo "$pos: $a $b $c $d $e $f $g $h";
28 state
="$a$b$c$d$e$f$g$h";
30 #Test if tones changed since last time
31 #echo test "$state" != "$last"
32 test "$state" != "$last" && {
This page took 1.277125 seconds and 4 git commands to generate.