3

I have to develop an app, where I must listen to sound using microphone. And whenever smoke alarm sound is detected, then the app must notify users that there is fire alarm. For that I am contemplating two possible solutions

1:) Convert smoke alarm sound to text using Speech To Text recognizer and store that text. And in the next time whenever the smoke alarm sound is received, the same Speech To Text recognizer converts it to the relevant text and if that text matches the stored text, then I assume it is alarm sound.

2:) Store the alarm sound and match the recorded sound wave to the store sound by comparing waveform. This is just my assumption as I am not expert in these areas.

So far,I have gathered that this technique of sound matching is done by audio fingerprinting i.e. each audio has a distinct fingerprint and if we are able to match the fingerprints of two audio ,then they are considered as identical.

For that I have recently found following links

http://www.royvanrijn.com/blog/2010/06/creating-shazam-in-java/

http://masl.cis.gvsu.edu/2012/01/25/android-echoprint/

https://code.google.com/p/musicg/

which seems closer to my problem's solution.I am still trying to grasp all these,but any help from you all will be widely appreciated.

laaptu
  • 2,963
  • 5
  • 30
  • 49

1 Answers1

1

I would suggest not to use speech-to-text as it will not recognise the alarm as a sentence/words.

What I would suggest - read about DFT and FFT.

Here is a little ugly example of DFT I have made for images(2d dft) . You can see the algorithm itself is very easy but in DFT case it's very slow. For 1d(sound) it should be quick enough.

What do I suggest - take in the sound data, run the DFT/FFT through it and you will get frequencies of your signal. Maybe then you can check if high range frequencies are powerful enough to detect the alarm.

In your case I would also check out other possibilities, like process frequencies of a few seconds and see if they match the approximate of alarm frequencies.

Good reading about FFT and what's behind it.

lukas.pukenis
  • 13,057
  • 12
  • 47
  • 81
  • Thanks for the reply,I will go through your guidance. So I have to implement it from scratch and knowing all the principles. Isn't there any 3rd party tools that have already implemented those i.e. run DFT/FFT on sound wave. The main reason for this is that I am not so great at Mathematics. – laaptu May 14 '14 at 06:40
  • There are plenty of libraries just look for DSP(Digital Signal Processing) libraries :) Also if you fear the mathematics - do not, read this article about FFT and what it does behind the scenes: http://betterexplained.com/articles/an-interactive-guide-to-the-fourier-transform/ – lukas.pukenis May 14 '14 at 06:45
  • Thanks for the help,I will Google it ASAP and if find the solution to it,I will gladly post here. – laaptu May 14 '14 at 06:46