How to restrict the Max Peak Height of findpeaks
Show older comments
I've managed to set a minimum peak height when plotting some data and finding the peaks but is there a function I can ue to set a max peak height? I can't seem to find one.

As you can see the errors are quite large. My code is as follows:
figure(nF)
findpeaks(ResAcceltrim,'MinPeakDistance',300,'MinPeakHeight',pe);
pks=findpeaks(ResAcceltrim,'MinPeakDistance',300,'MinPeakHeight',pe);
pks=pks(1:20,1);
Accepted Answer
More Answers (1)
dpb
on 12 Oct 2015
0 votes
You're correct there is no such facility built into findpeaks--one would normally think a large peak would be agoodthing(tm), not something to be avoided.
You'll have to simply test and exclude results from the returned search that exceed the rest by some magnitude (either absolute or as a percentage). Typical tests for outliers might be a ploy to consider in doing so unless you have other ways to decide what is "noise".
Categories
Find more on Descriptive Statistics in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!