SIT tones using Python or C#

Asked

Viewed 254 times

3

Hello, I’m making an app that detects SIT tones (https://en.wikipedia.org/wiki/Special_information_tones). I understand very little the mathematics involved in Fourier transforms and signal processing. What I’m trying to do is figure out how to identify if these patterns occurred in a voip call. To test, I’m using a recorded file. I’ve tried to understand some algorithms for frequency identification, but I need to take it as described in the wikipedia link. That is, to check if there were three taps with those specific frequencies at that specific duration, with that specific interval. All I’ve been able to do so far is identify that the frequency occurs in the audio, but I couldn’t figure out how to see if it occurred during the correct time period. (Each code has a permuted sequence of the same frequencies) Does anyone have any idea how I could solve this?

2 answers

1


Frequency algorithms will show you which is the fundamental frequency of the analyzed block, you will need to know which frequencies compose the audio as a whole, I strongly recommend that you understand the mathematics behind Fourier, you have two paths to identify frequencies:

  • Apply FFT, use fixed size blocks, this size will get you tell the duration of each analysis block, if a signal is sampled to 8000 Hz then a size analysis block 4096 will give you 4096/8000 = 512 ms analysis, can be computationally little efficient do this for what you need, but this will give you a x-ray of all frequencies contained in the signal within this block, the frequencies you seek are senoids and in this case you should look within the return of the FFT if the senoids of your interest have greater amplitude than n dB and that all other senoids are null or below a certain range of interest.
  • OK I showed you how to do this kind of brute force, the way really efficient to find your frequencies is to use the algorithm of Goertzel, with it you will be uniquely looking for the frequencies of their interest and not within the whole spectrum.

Python can really make things easy, using Scipy/Numpy will help you a lot in analytics.

  • Hello, @ederwander. I have already made an attempt using goertzel, but it informs the frequency and all its occurrences (I do not know how the distribution of occurrences works), not the duration of this frequency or the intervals. From what little I understand of Fourier, he picks up a wave and decomposes it into senoids of different sizes and/or occurrence points. As I need to identify if there was a touch of three distinct frequencies with specific duration and interval, I believe I need to take the two points where the senoid touches the x-axis (time?) for a specific frequency. Ideas?

  • I used this python script to check if the frequency occurs or not: https://gist.github.com/sebpiq/4128537. It returns all frequency occurrences to me.

  • I did a test with this same algorithm using two different files. One that has the tones and one that does not. For both cases, he returned coefficients greater than zero. Even, I was thinking that these tones (SIT) are not like the DTMF that are the sum of two frequencies. SIT is a sequence of three specific tones.

  • hi @Diogopaschoal yes Goertzel is very used to find Dtmfs, for your case it will work very well, one of the ways to trace more or less the duration of a certain frequency is to separate the signal in blocks of fixed sizes for example 2048/8000 = 256ms, ie send 2048(256ms) samples to goertzel by the end of all your signal, you will have to go walking with a for, repaired who 256ms is below the time needed Short duration = 276 ms that is to say q in the next sample you will still have to search if you still have the previous frequency and a new .

  • I gave example of sending 2048 samples, but if their signal is sampled at 8000hz the size 1024 will work very well for what you need. let’s go to the calculations. 8000/1024 = 128ms this means that the same frequency in Short duration have to appear twice when sending two samples in a row 128+128 = 256ms, and a frequency in Long duration has to appear 3 times in a row 128*3 = 384ms, do not forget to consider the silences in your calculations there...

  • Thank you, @ederwander. I’m already studying a material I found in http://professor.ufabc.edu.br/marcio.eisencraft/pds/pds.htm to understand, but your explanation of how to obtain the samples has already helped a lot. I’ll try to apply with what I’ve already found.

Show 1 more comment

0

I never really had to do this but I would start looking for an audio library, like pyaudio.

If she doesn’t have something that already solves her problem, another option is to use Scipy/Numpy for calculating the transformed (FFT) and analysing the sample frequencies.

  • Hi, @sergiopereira. I used scipy/numpy with the goetzerl script I copied in the comment above, but I still need to understand the times and durations.

  • @Diogopaschoal honestly, I don’t know. It’s been 20 years since I studied this in college and the only time I worked in telephony we had hardware that made this detection and the program received a callback. The best I can suggest is this post is SO

Browser other questions tagged

You are not signed in. Login or sign up in order to post.