MATLAB Answers


How to detect peaks above a certain threshold in matlab

Asked by pavan sunder on 20 Nov 2016
Latest activity Commented on by Image Analyst
on 25 Aug 2019
How to detect peaks above a threshold in a signal and store their locations.
I wrote a code:
But i didnt get any there any other way?..kindly help me with matlab code.


Sign in to comment.

3 Answers

Answer by Walter Roberson
on 20 Nov 2016

  1 Comment

Does MinPeakHeight filter based on the peak height above the peak base, or based on absolute signal values? The documentation is not clear to me. It says "Minimum peak height, specified as the comma-separated pair consisting of 'MinPeakHeight' and a real scalar. Use this argument to have findpeaks return only those peaks higher than 'MinPeakHeight'." But it's not clear that "higher" means to them.

Sign in to comment.

Answer by Image Analyst
on 20 Nov 2016

If MinPeakHeight doesn't work, then you can always threshold your original signal to set values below the threshold to the min.
minValue = min(yourSignal);
yourSignal(yourSignal < threshold) = minValue;
then call findpeaks.


Sign in to comment.

Answer by sohab azhar on 11 Aug 2019

i have converted a colour video into histogram now i have to get the number of highest peaks in histogram how can i do it?


Show 1 older comment
Why do you think you need this? The number of peaks seems uselss. Let's say you had 25 peaks, or 50 peaks. What will you do with that number?
Are you planning on doing color classification afterwards? Why not try classify()? Post your images and desired output in a new question.
yes i have used findpeaks() but it is not working , actually i want to apply threshold and get number of peaks above that threshold.
You either do not have the Signal Processing Toolbox installed, or you're not applying the best set of input parameters to findpeaks(). That's about all we can say since you have not shared your signal, your code, or your error message. "It is not working" is, as I'm sure you can imagine, about as useless and unhelpful description of the problem that is possible. What are we supposed to do with that? I guess, just refer you to this link

Sign in to comment.