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