I have a graph that takes the values from first maximum peak point and plots it.Now,how shall i introduce a threshold or descend order from that point,so that it find the next highest peak ?
load('signal')load('t')S(:,1)=[ 5 15 35 45 5 15 35 45];S(:,2)=[ 5 15 15 5 45 35 35 45]; for k=1:1:length(S) [a(k),b2(k)]=max(abs(hilbert(signal(k,:)))); % first peak amp & index
[PkAmp, PkTime] = findpeaks(abs(hilbert(signal(k,:))),t); peaks(1,1)=a(k); peaks(2,1)=t(b2(k)); j=2; for i=1:length(PkTime) if PkTime(i)>t(b2(k)) peaks(1,j)=PkAmp(i); peaks(2,j)=PkTime(i); j=j+1; end endfigure; plot(t,(signal(k,:)),t,abs(hilbert(signal(k,:))),peaks(2,1),peaks(1,1),'ro') hold on;grid on plot(PkTime, PkAmp, '^r', 'MarkerFaceColor','r') xlim([0 0.0006]);ylim([-inf inf]) hold on,plot(peaks(2,3),peaks(1,3),'ko') end
Best Answer