Reputation: 2669
I have a signal which is depicted in the following image:
I want to calculate the 4 high peaks that occur inside the signal. Is there any algorithm that can detect my signal?
Upvotes: 0
Views: 1025
Reputation: 4510
how about something like this?
[localmax,maxind] = findpeaks(x);
inversex = 1.01*max(x) - x;
[localmin,minind] = findpeaks(inversex);
%//this gives all maxima and minima, now you can compute the width.
%//as for the top 4 peaks, surely you just sort and index 1:4 upon the result or in the beginning.
Upvotes: 1