I have a problem with the peaks of a vector. All help will be appreciated.
Consider a vector of 1280 values which has a initial plot diagram below;
i only want to find two highest peak, segment and preserve the related values while tuning the other little peaks into zeroes like in the figure below.
Thank you so much in advance.

1 件のコメント

Youssef  Khmou
Youssef Khmou 2013 年 12 月 24 日
編集済み: Youssef Khmou 2013 年 12 月 24 日
did you try some existing peak detection algorithms? this seems like a difficult test, if the result is based on random events, can you use Monte Carlo trials and average them to get a smooth function?

サインインしてコメントする。

 採用された回答

Image Analyst
Image Analyst 2013 年 12 月 24 日

0 投票

Try findpeaks() if you have the Signal Processing Toolbox. Otherwise you can use this File Exchange submission: http://www.mathworks.com/matlabcentral/fileexchange/25500-peakfinder
Another way, if your peaks are consistent, is to threshold at 600. Then find the beginning and ending of each peak by calling diff(signal>600) and looking for +1 or -1.
So, which ever way you did it, you now need to find the bottom left and the bottom right of the peak. So scan away from the peak so that you "fall down" the peak until you get to zero. Now you know the complete extent of all peak. You'll have a logical vector of there there is or is not a valid, desired peak. Then you can zero out the non-peak elements:
signal(~validPeakLocations) = 0;

その他の回答 (0 件)

質問済み:

2013 年 12 月 24 日

回答済み:

2013 年 12 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by