# Detection of sharp peaks in an audio signal

I have an audio signal and I'm interested to detect the very sharp peaks.

If I zoom, here is something that should NOT be detected (this is voice actually):

NO GOOD

Here is something that should be detected:

GOOD

Ideally, a CNN with some training would be the best solution but I'm too limited in terms of computation to run it.

So, I'm looking for an easy solution with a simple signal processing algorithm (filters and others things).

I have already developed a simple algorithm based on the maximum of a 10ms window and if I see that the maximum is low, then suddenly very high, and then low again, I have a detection.

But it's not outstanding. Any better idea? Is there any filter that can find me "sharp" peaks?

• might not be so easy. you might need to run a pitch detector on this, not so much to estimate pitch, but to estimate how "pitchy" it is. (how periodic a signal is.) that can be used to differentiate between "voiced" and "unvoiced" sounds. Feb 23 '19 at 3:06
• i gotta post about pitch detection here. again the measure you're interested in is the maximum normalized autocorrelation that is not at a lag at or close to 0. Feb 23 '19 at 3:09
• It's interesting though it's a lot of maths. I'm not sure how to get the relevant "bits" from it. I would like to add a couple of comments. First, the first super sharp 'pulse' of those peaks I'm trying to detect are always around 1kHz. I tried a band-pass but voice is "strong" at 1kHz so it's not helping. Secondly, there is no fixed period between the targeted peaks. On my example, it seems that they are elapsed every 1.5s but it's just a coincidence. Feb 23 '19 at 6:23
• the relevant bit is to recognize a waveform (whether it's "peaky" or not) over just noisy crap (that has peaks in it), you need to measure how periodic that waveform is. pitch detection does that (in addition to measuring the period of the periodic waveform). so if you can measure the periodicity of the waveform, you have one metric that tells you where the vocal is and not confuse it with where the vocal is not. Feb 23 '19 at 7:12
• @gregoiregentil: Do all the "peaks" that you aim to detect belong to the same class of audio events, e.g., drum transients? Feb 23 '19 at 9:32