LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Find tone/frequency (dtmf etc) in soundfile using sox (https://www.linuxquestions.org/questions/linux-software-2/find-tone-frequency-dtmf-etc-in-soundfile-using-sox-4175453005/)

need2know 03-06-2013 02:22 PM

Find tone/frequency (dtmf etc) in soundfile using sox
 
Hi

I have this (hopefully) simple problem.
I have a bunch of soundfiles and i want to be able to find a specific tone/frequency in them, or rather check IF they exist.

To make a simple example DTMF tones are the simplest ones. How do i know if a soundfile contains the DTMF tone 1 for example. And just for the record this should not be limitied to DTMF tones, this is just to give an example.

I would like to check for a specific frequency and go through the file and if the dB is higher then normal for a specific span i would concider that a confirmation.

I would prefer to use sox but good alternatives are welcome, any perl-solutions would also be appreciated.
I have been sitting with this for several hours and just cant get it to work.

If i run spectrogram in sox i can clearly see the tone at a specific frequency at a higher dB then the rest frequencies, but how do i get this out in code.

Please help.

Thanks for your time!

/Daniel

business_kid 03-07-2013 08:58 AM

1 Attachment(s)
What you suggest is the Holy Grail in programming of music guys.
If you have dtmf tones, they can be easily interpreted. One at a time, that is. For sound, it's horribly complicated as even a quick look with gnuplot would show you. If you have gnuplot (or mathlab), try this line in it (or look at the attachment).
Quote:

plot [-4*pi : 4*pi] sin(x) +sin(1.5*x) +sin(2*x)
Now that's simple enough - a 3/2 and 2nd harmonic (2nd harmonic = one octave musically). Spectrum analysis is about your only way of debunking that stuff. Even then you're struggling.


All times are GMT -5. The time now is 07:45 PM.