tolpk - peaks raising by a tolerance

版本 1.0.0.0 (1.9 KB) 作者: Miroslav Balda
The function finds all peaks raising above adjacent valeys by a tolerance
2.0K 次下载
更新时间 2009/1/12

查看许可证

TOLPK finds all peaks raising above adjacent valeys from both sides by a given tolerance. The function tests differences between peaks and adjacent valeys of an arbitrary function and returns indeces of peaks raising above neighbouring valeys more than an allowed tolerance. The function finds at least one highest peak even in case of small ripple (noise) over all function values.

Call of the function:
I = tolpk(tol,y);
Input arguments:
tol = Tolerance for skipping over small peaks
>0 tolerance in units of y,
<0 tolerance in percents of the maximum peak of y
y = samples of the function y(x) for monotone sequence of x,
x = argument of the function y(x).
If no x is given, vector x = 1:length(y) will be generated.
Output parameter:
yp = vector of peaks with relative heights greater than tol, and maximum peak including
xp = argument values of yp.

Example:
tol = -5; % tol = 5% of y_{max}
x = 0:.1:2*pi;
y = sin(x)+.15*cos(51.23*x)+.07*sin(141*x)+1;
plot(x,y); hold on, grid on
[yp,xp] = tolpk(tol,y,x); % coordinates of accepted peaks
plot(xp,yp,'*r')
hold off

引用格式

Miroslav Balda (2024). tolpk - peaks raising by a tolerance (https://www.mathworks.com/matlabcentral/fileexchange/22662-tolpk-peaks-raising-by-a-tolerance), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2006b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Descriptive Statistics 的更多信息
标签 添加标签

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0