I am trying to record a sound two times and compare the two recordings. I am playing exactly the same sound both times (for example, play a small .wav file twice and record it each time), so I hoped that my attempt would not rise to the complexity of Speech Recognition...
I have tried computing the DFT (using FFT) and comparing the two power spectrums of the signals (more precisely, comparing their MSE - Mean Squared Error), but the results were discouraging (sometimes for recordings of the same sound the error was greater than for different sounds)...
Then I found out about the MFCCs and computed them for each signal. That leaves me with 12 coefficients for each frame I devided my signal into (details below). How should I combine these groups of 12 coefficients to get some value(s) that describe the whole signal?
(Appending them and extracting the MSE for the two arrays did not return encouraging results either...)
Below are some details about the way I computed the MFCCs and values I chose for computing it. Maybe it's here that I'm doing something wrong:
(sample rate = 22000 Hz)
- Framing with frame size = 512, frame overlap = 200. (because "each frame should be ~20-30ms long" and 512 / 22000 = 0,023 seconds = 23 ms. As "the overlap should be of ~10ms and 200 / 22000 = 0,009s = 9ms)
- Apply Hamming window to each 512-size frame.
- Apply FFT to each windowed 512-size frame => 512 magnitudes for my signal, from witch I use only the first 256. Domain: Hz from 0 to 22000 (to 11000, respectively)
- Compute the Mel Filter Bank: (min frequency = 300 Hz, max frequency = 11000 Hz)
- Compute mels from min and max frequences and then compute 26 equally distanced values between these two mel values.
- Convert them back to Hz => array of 28 frequency filters.
- Compute a filterbank (filter triangle) for each three consecutive values => 28 - 2 = 26 filterbanks.
- Pass the whole power spectrum (256 magnitudes) from step 4 through each triangular filter to get a "filterbank energy" for each filter => 26-sized array of energies.
- Apply log: ln(each energy) (they are still frequency-domain values)
- Apply DCT to the logged energies => 26-sized array of (time-domain?) values.
- Take only the first 12 => 12 MFCCs for each 215-sized frame of my signal.