The following code find the peaks in my signal perfectly.
[pks,locs] = findpeaks(Power,depth,'MinPeakDistance',100,'MinPeakProminence',4);
But I am more interested in the descending order peaks and the code should exclude the values not following the desceding order pattern.
For instance at locs = [1,2,3,4,5,6,7], pks are [100,80,60,70,50,80].
Required: [pks1,locs1] = function_descending(pks,locs);
I only need pks and corresponding locs which are only in descending order like the result should be locs1=[1,2,3,5] and pks1=[100,80,60,50]. It should exclude the values which contradicts the descending phenomena. The values of 70 at position 4 and 80 at position 6 are excluding because they are higher then all preceeding numbers.