Determining turning points about a peak in plots

2 views (last 30 days)
The plot below depicts peak linear acceleration associated with an impact.
It is my goal to determine the precise duration of this impact, that is, by identifying the first major turning points on either side of the peak value.
I am somewhat novice to Matlab and would greatly appreciate guidance.
Thank you, John

Accepted Answer

Star Strider
Star Strider on 9 Apr 2014
I suggest taking the numerical derivative, at least initially:
dydt = diff([0 LinAccel]) ./ diff([0 Time]);
and look for the appropriate sign reversals. I don’t know how noisy your data are, so you will have to take that into consideration as you interpret the derivative data. (The code snippet here is for row vectors for your variables. For column vectors, put a semicolon (;) after the first zero in the diff statement vectors.)
  2 Comments
John
John on 10 Apr 2014
Edited: Walter Roberson on 13 Apr 2014
Thank you Star Strider, your answer helped me. Here is the final code that worked:
LinAccelLAMp=nan(size(LinAccelLAM));
LinAccelLAMp(2:end-1)=(LinAccelLAM(3:end)-LinAccelLAM(1:end-2))/(2*(1/Fs));
toleranceS=find(diff(abs(LinAccelLAMS)) > 15);
toleranceE=find(diff(abs(LinAccelLAME)) > 15);
% subplot(2,1,1);
% plot(TimeLA,LinAccelLAM,'b',TimeLAS(toleranceS),LinAccelLAMS(toleranceS),'ro','MarkerSize',10); axis tight; grid on;
% subplot(2,1,2);
% plot(TimeLA,LinAccelLAM,'b',TimeLAE(toleranceE),LinAccelLAME(toleranceE),'rd','MarkerSize',10); axis tight; grid on;
IS=TimeLAS(toleranceS); IE=TimeLAE(toleranceE);
LAImpactStart=min(IS); LAImpactEnd=min(IE); LAImpactDuration=LAImpactEnd-LAImpactStart;

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!