2
$\begingroup$

I have an audio file, of which I calculate 16 (actually 15 because I omit the first one) MFCCs in R. When I stream this file via VLC-Player and Icecast2-Server, receive it in Java (with the Player of Javazoom-Lib) and then pass it on to R again for MFCC calculation I get completely different values? Has anyone an idea why this could be?

Additional info:

  • When I write the received data to a file again and view it next to the original file they look almost the same (Waveform + Spectrogram).
  • The file has a length of 3 seconds and contains the sound of a passing vehicle (car).
  • MFCCs are calculated for centered 44100 samples.
  • I need valid data in order to automatically classify cars and trucks with a SVM. This classifier is trained with features calculated from 150 audio files (each containing one vehicle).
  • Since R had problems with reading and processing mp3-files directly I first converted wav to mp3 and back again (in order to "simulate" the loss of information due to compression).

MFCC values

Furthermore, I automatically detect the vehicles in a continuous audio stream and therefore (for the particular example data above) the waveforms for calculating the MFCCs have an offset of about 4400 Samples. Does this matter with an analysis window of 44100 samples?

$\endgroup$
8
  • $\begingroup$ Usually analysis window is way shorter to make sure that signal is as close to stationary as possible. Nevertheless this tiny offset shouldn't matter. I would worry about other things like overlap or training set. Anyway, question is for you- what is the TP/FP rate? $\endgroup$
    – jojeck
    Commented Mar 11, 2015 at 19:31
  • $\begingroup$ I have 150 feature vectors (75 of each class) and then take 120 of them (randomly) to train a ksvm with a rfb-dot kernel. The remaining 30 feature vectors are used to test the model. I get error rates of 0 to 12 percent. Since I'm not familiar with machine learning I don't really know what TP/FP rate is. $\endgroup$
    – msc
    Commented Mar 12, 2015 at 17:16
  • $\begingroup$ In my opinion this is quite a good result and when I first tested it with the streamed data instead of "single files" I had no idea why it classified every vehicle as truck. $\endgroup$
    – msc
    Commented Mar 12, 2015 at 17:18
  • $\begingroup$ Which approach are you using for multi class SVM, one-vs-all? You should read about True Positive and False Positive rate, as well as other metrics (ROC curve, etc.). Testing is usually more important than training! And for God sake, please do not try to analyse MFCC's by eye inspection. $\endgroup$
    – jojeck
    Commented Mar 12, 2015 at 17:23
  • $\begingroup$ I just have 2 classes: car and truck. Ok, so do you have any advise on how to proceed with my problem? $\endgroup$
    – msc
    Commented Mar 12, 2015 at 17:45

1 Answer 1

3
$\begingroup$

You say:

I stream this file via VLC-Player and Icecast2-Server, receive it in Java (with the Player of Javazoom-Lib)

When you receive the stream in Java, what is the stream format?

You say that it is the "same" because the waveform and/or spectrogram look similar, but the MFCCs will come out different if the stream format (sample rate, bit depth, etc) are different.

Can you confirm by printing out the stream formats

  1. Before sending to Java
  2. Upon receiving from Java?

I recommend using Soxi to print out the stream format (if you cannot otherwise dump it from R, or Java)

If you can eliminate stream format issues, mp3<->wav issues (deal only in wav), if you analysis windows are identical (as jojek says), then your MFCCs should come out identical.

$\endgroup$
4
  • $\begingroup$ Lossy formats usually give better performance. $\endgroup$
    – jojeck
    Commented Mar 11, 2015 at 22:24
  • $\begingroup$ Edited my response to clarify that for debugging purposes, eliminating extra (en/de)coding steps can be helpful. $\endgroup$ Commented Mar 11, 2015 at 22:44
  • $\begingroup$ The streamed file is the same as the file that I use for comparison so the formats are the same right? (mp3, 320 CBR, 44100) $\endgroup$
    – msc
    Commented Mar 12, 2015 at 16:46
  • $\begingroup$ I can't use wav because later on I need to stream recorded audio in real-time and couldn't figure out how to do it with anything other than mp3. $\endgroup$
    – msc
    Commented Mar 12, 2015 at 16:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.