I have imported a wav sound that a = Import["sound.wav"]

and we know that soundStrength = a[[1]][[1]] is a list of sound strength at each sample point.

Now I have a sound file of a metal ball keeping falling onto ground and jumping up, the wave is like thiswave

It actually is a series of Damped sine wave with their maximum decreasing too.

Now I want to find every collision point, that is the index of each local maximum (absolute value) of the list soundStrength.

The collision in the end phase may be very dense like thisenter image description here

As suggested, here is the wav file: https://www.dropbox.com/s/iht8fzsf3yvzwv6/temp.wav.

EDIT: This problem is not to simply find all local maximum value, but to find a maximum in a range. And the range varies(more specifically, the range is narrowing).

After using MaxDetect, we can get something. This is a general look at the points(after using MaxDetectonce):enter image description here

And this is a view of endmost part:enter image description here

Now the difficulty here is to find the highest points which belongs to its own region. Or we can say how to find the points which can form an envelope line of the graphic.

  • $\begingroup$ I recommend that you post a list of example data or a file that can be downloaded such that other users can play around with it and develop solutions. $\endgroup$
    – g3kk0
    Mar 29, 2014 at 18:32
  • $\begingroup$ @g3kk0 I have upload the file onto dropbox, thank you for your suggestion! $\endgroup$
    – Nepls
    Mar 30, 2014 at 4:54

1 Answer 1


I suggest using the function MaxDetect. From the documentation you can directly see how it works. Here is a slightly modified example.

data = Table[Sin[0.1 \[Pi] n + 1.] + Sin[0.5 \[Pi] n + 2.1] + 
    RandomReal[{-1, 1}], {n, 0, 127}];

ListLinePlot[p = PeriodogramArray[data], PlotRange -> All]

enter image description here

ListPlot[MaxDetect[p, 5]]

enter image description here

With some tweaking of parameters it should be easily applicable to your data.


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