%%%ÕÒ»ØÔ­²¨·åµã
function peak=findpeak(wave,innpeak,L)
peak=zeros(length(innpeak),1);   
for I=1:length(innpeak)
    if innpeak(I)<=L
        temp_p=1:innpeak(I)+L;
    elseif innpeak(I)>length(wave)-L
        temp_p=innpeak(I)-L:length(wave);
    else
        temp_p=innpeak(I)-L:innpeak(I)+L;
    end
    temp_input=wave(temp_p);
    [~,peak(I)]=max(temp_input);
    peak(I)=peak(I)+temp_p(1)-1;
end