从信号中提取峰值

Extract peaks from a signal

我有一个信号,如下图所示:

我想计算信号内部出现的 4 个高峰。有什么算法可以检测到我的信号吗?

这样的怎么样?

[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.