简体   繁体   中英

Using FFT to compare two audio files and then realtime comparison

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 inte.net 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM