Solved

# acoustic fingerprint

Posted on 2011-03-02
504 Views
How to generate an acoustic fingerprint? I am programming in java. Are there any libraries or algorithms for doing this under LGPL? I am converting the sound file using FFT (using class for doing fft from this library http://sirk.sytes.net/). The output I am getting is FFT values which I assume by looking at the code are magnitudes of sound. How to generate and acoustic fingerprint that and how to compare it to check whether two sounds are matching?
0
Question by:chudyksg

LVL 27

Expert Comment

ID: 35017853
The FFT takes one or more time samples of sound and generates frequency spectra: how much of each
frequency is included in the sample.

If two sound samples are the same, then their FFT's will be the same.

You can calculate the RMS difference of two FFT's fairly easily:

D²   =   Sum(  (f_A0 - _fB0)²  +  (f_A1 - f_B1)²  +  ....  +  (f_An - f_Bn)²)/n

0

LVL 27

Expert Comment

ID: 35017860
You would have to do some testing/human evaluation to decide on threshold value for D.
0

Author Comment

ID: 35020659
Yes but sometimes the sound samples are not going to be the same but will be similar. Then I would have to use some sort fuzzy logic, or fuzzy matching. E.g. If I record a sound of breaking glass and store the acoustic fingerprint in the database then I would record a sound of breaking glass again I would like to get an output that they match.
0

LVL 37

Expert Comment

ID: 35021290
If they are similar, then the RMS difference (D² above) will be low. As d-glitch already said, you'll just have to use testing to decide what levels you want to use to mean a match.
0

Author Comment

ID: 35026770
What if they have different length? Then they are not going to produce similar fft values in similar order
0

LVL 27

Expert Comment

ID: 35027448
The FFT typically works with fixed length time samples.

If you were doing this in real time, you would store 100 ms of data,
then run it through an FFT, then do the template matching.
If there was a breaking window during that time, you would flag it.

Then you go on to the next 100 ms of data.

In addition to the FFT, you would also have to do some sort of level scaling.
A breaking window 30 feet from the microphone will not be as loud at one
5 feet away.

Are you really looking for breaking glass, or are you looking for more general
applications?
0

Author Comment

ID: 35027689
yep recognizing sound such as glass breaking, tv noise, washing machine noise
0

LVL 11

Accepted Solution

pmasotta earned 500 total points
ID: 35352827
forget about RMS differences they include the mean value and they could be different; the same sound but different volume...

What you have to do is to "correlate" both FFTs by convolution, (be carefull this is different than "convolution by FFT")

Having the 2 FFT spectra the convolution of them will give you a new function that shows how correlated both FFT patterns are, from there you can discover if it is the same sound, shifted in frecuency, etc,etc...
It is not an easy topic, your proyect is quite ambitious...

0

## Featured Post

### Suggested Solutions

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.