I'm writing a Master degree thesis on Instrument Recognition using pyAudioAnalysis. I was wondering if results could be improved by also analyzing the ADSR shape of the samples. All I find on the internet about ADSR is related to sound synthesis, not analysis.

Do you think it may be possible to compute ADSR, maybe manually by monitoring the energy over time and detecting when energy is kind of stable? Would it make sense?


... Instrument Recognition using pyAudioAnalysis. I was wondering if results could be improved by also analyzing the ADSR shape of the samples.

In a pattern recognition setting, additional features could lead to better classification results, provided that they can better "differentiate" the phenomenon being "measured".

Because of psychoacoustics, human beings are capable of distinguishing timbre from the first few milliseconds. As an extreme example, if you listen to a guitar and a similar piano tone, half way through they have started playing, it is very difficult to tell them appart. For example, here is Yngwie Malmsteen sounding like a flute, a violin, a guitar (or two) just by modulating the Attack via the guitar's volume (notice his right hand after the "without echo" part).

Now, for some piano tones and some guitar tones it might be difficult to tell them appart just by their spectral content because they are in similar ranges. But if you hit some bass tones on the piano, really hard, they will Sustain differently because the strings are now less of a string and more of a rod, which vibrates differently (than a taut string). In that case of course, the timbre will start having differences too.

So, ADSR based features would help in instrument recognition when the spectral characteristics of two or more instruments are near enough to be mixed up by a classifier using just spectral features. (For more information, please see this link).

How you are going to do this is another issue because it's not as easy as just running some metrics on some recordings. The instruments would have to be recorded "clean" in a room with minimal reflections and under controlled conditions. Certain instruments will sound differently for the same tone if it was to be played softly or loudly and the range of each instrument would have to be taken into account to decide on the Sampling Frequency. All of theses parameters will have an impact to your classification performance.

So, assuming a set of clean recordings, you could obtain the envelope of the waveform to then try and infer the ADSR phases from that curve and use these figures in your classifier. For a brief overview of automatic ways of extracting the envelope please see this link while an example (using the analytic method of deriving the envelope) in Python is available from this link.

Hope this helps.

  • $\begingroup$ This is amazing! This is exactly what I was looking for, well documented and clean. Thank you, I'd upvote thrice if I could :) $\endgroup$
    – phagio
    Nov 8 '16 at 6:13

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.