I'm implementing a gunshot detector following the article "Algorithm for Gunshot Detection Using Mel-Frequency Cepstrum Coefficients (MFCC)" (paywall).

In the article, the authors uses 22 features based on MFCC (coeficients normalized between 0.1 and 0.9). One of the features is "Standard deviation of fundamental frequency". I already spent all my day trying to figure out the proper way to do this calculation.

The expected value for a gunshot is near 0.04.

  • $\begingroup$ So, where exactly does your problem lie? in the finding of the fundamental frequency, or in the finding of its variance? $\endgroup$ – Marcus Müller Jun 22 '19 at 14:49
  • $\begingroup$ The fundamental frequency. $\endgroup$ – Hugo Sartori Jun 22 '19 at 15:37
  • $\begingroup$ I made some implementation using some formulas I found over the internet, but the results are very unrealistic compared to the expected. $\endgroup$ – Hugo Sartori Jun 22 '19 at 15:39
  • $\begingroup$ Sadly, I don't have that paper. Can you maybe edit your question with a link to said paper? I'd assume the authors define how they mean fundamental frequency, and over which time window they want to determine it. $\endgroup$ – Marcus Müller Jun 22 '19 at 15:41
  • $\begingroup$ Done. That's why I'm suffering a lot, every paper has a lack of explaination some how. I always need to dig the information somewhere else, the big problem is on calculations that needs some kind of parameters that the authors generaly simply don't talk about. $\endgroup$ – Hugo Sartori Jun 22 '19 at 15:49

You calculate fundamental frequency of the signal with some pitch extraction algorithm, for example YIN, https://github.com/ronggong/pypYIN. It is a vector of numbers, then you calculate standard deviation of it, that would be a number.

Overall, this feature is not very important for detection. Also, the paper you are trying to reproduce is not quite modern, these days you can get much better results with VGGish and Audioset, something like





Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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