I have a guitar music signal and I want to detect the onset points via energy.
This is the signal example:
This is the energy plot:
My question is what would be the best method defining the threshold and consequently finding the peaks. I reckon I will have to set a window length and a window step (I am thinking 1000 and 100 samples respectively on a 44.1KHz sampling rate) and then every loop defining a new threshold (adaptive/local threshold). Every loop I would have to find the window average and compare it to the threshold. I have these questions:
1) Does window length = 1000 samples and window step = 100 seems reasonable?
2) How the threshold would be defined each loop and in relation to what?
3) If a window is above length which samples in it would I consider peaks? I think it would be somewhere in the middle but what range around it?
Maybe, window middle - window step < peak samples < window middle + window step ?
Thank you for your help.