snake plissken
snake plissken

Reputation: 2669

Extract peaks from a signal

I have a signal which is depicted in the following image:

enter image description here

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

Answers (1)

GameOfThrows
GameOfThrows

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

Related Questions