select local maxima in energy signal
I would suggest to apply a median filter like

y=filter(1,0.05*ones(1,20),x)


And then apply Matlab function "findpeaks"

As an alternative to second step you perform a segmentation based on different from zero areas like in

ne0 = find(A~=0);                                   % Nonzero Elements
ix0 = unique([ne0(1) ne0(diff([0 ne0])&gt;1)]);        % Segment Start Indices
ix1 = ne0([find(diff([0 ne0])&gt;1)-1 length(ne0)]);   % Segment End Indices
for k1 = 1:length(ix0)
    section{k1} = A(ix0(k1):ix1(k1));
end
celldisp(section)                                   % Display Results


And then perform calculation on each segment. For example sum all samples and divide by number of samples.