Algorithm that recognizes decays

1 view (last 30 days)
Imane Ihaddouchen
Imane Ihaddouchen on 8 Oct 2020
Edited: Imane Ihaddouchen on 5 Nov 2020

Answers (1)

Shashank Gupta
Shashank Gupta on 14 Oct 2020
Hi,
You can tackle this problem by using first order derivative of the data. First find the difference array, you can refer to diff function and create a difference array, you can use this array to find peaks and dips in the data. those peaks and dips are the point which you intent to find, try looking at findpeaks function, it will help you find those points. I am attaching a small placeholder code for you to refer.
% find difference array.
diffArr = diff(z_3);
% Find peaks.
[peakValues,peakIdx] = findpeaks(diffArr);
% Find dips.
% just invert the data and use the same function.
invertedY = max(diffArr) - diffArr;
[dipValues, dipIdx] = findpeaks(invertedY);
I hope this helps you to atleast get some headstart.
Cheers

Community Treasure Hunt

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

Start Hunting!