java – Using FFT to compare two audio files and then realtime comparison-ThrowExceptions

Exception or error:

I am making an application for Android that will save users voice command and then while the application is running; compares the realtime data from the mic input to the one that is saved. So far I have saved the voice in wav file now I want to compare it to the input stream. I have applied FFT using this API as it is compatible with Android:

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

I dont know much about this api either but, I think the FFT data is stored in FrequencyTimeDomainRepresentation object. I searched on the internet and found out that I have to use a window to compare the data but, I am clueless how to do so.
I don’t know how how to compare the data.

Please tell me how to compare the FFT data and how do I match the saved file data with the input stream data, I mean code. Meanwhile I am trying to compare two audio files using java not on android for now.

Any help would be appreciated,
Thanks.

How to solve:

As mentioned in the comment this is a dsp related question. You should ask for details at the dspexchange.

But to give you a quick’n’dirty answer. Define exactly what your algortihm should do. Should it do voice recognition? If you just want have a simple measure for simliarity use cross correlation (ask google). You also don’t need FFT for that (FFT seems to be overused a lot, lately. Everybody not knowing what (s)he’s doing comes up with that FFT stuff). An FFT might come into play once you know what you want to do and you know that you really need it; perhaps for applying some psychcoacustic model. But even then a simple haar transform might be more sufficient, simpler and faster, especially on moblie devices.

Leave a Reply

Your email address will not be published. Required fields are marked *