File Exchange

image thumbnail

Segmented peak finder findpeaksSG.m

version 1.0.0.0 (13.3 KB) by Tom O'Haver
Peak finder for signals containing peaks of widely variable widths.

4 Downloads

Updated 19 Nov 2016

View License

Segmented peak finder, findpeaksSG.mn, has the same syntax as findpeaksG.m, except the 3rd to 6th input
arguments can be vectors with one entry for each segment.
function P=findpeaksSG(x,y,SlopeThresholds,AmpThresholds,smoothwidths,peakgroups,smoothtype)
Locates and measures the positive peaks in a noisy x-y time series data.
Detects peaks by looking for downward zero-crossings in the first
derivative whose upward slopes exceed SlopeThreshold. Returns list (P)
containing peak number and position, height, width, and area of each
peak. Arguments "slopeThreshold", "ampThreshold" and "smoothwidth"
control peak sensitivity of each segment. Higher values will neglect
smaller features. "Smoothwidth" is a vector of the widths of the smooths
applied before peak detection; larger values ignore narrow peaks. If
smoothwidth=0, no smoothing is performed. "Peakgroup" is a vector of the
number points around the top part of the peak that are taken for
measurement. If Peakgroup=0 the local maximum is taken as the peak height
and position. The argument "smoothtype" determines the smooth algorithm:
If smoothtype=1, rectangular (sliding-average or boxcar) If
smoothtype=2, triangular (2 passes of sliding-average) If smoothtype=3,
pseudo-Gaussian (3 passes of sliding-average)
See http://terpconnect.umd.edu/~toh/spectrum/Smoothing.html and
http://terpconnect.umd.edu/~toh/spectrum/PeakFindingandMeasurement.htm
(c) T.C. O'Haver, 2016. Version 1, November, 2016

Cite As

Tom O'Haver (2021). Segmented peak finder findpeaksSG.m (https://www.mathworks.com/matlabcentral/fileexchange/60301-segmented-peak-finder-findpeakssg-m), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (1)

Tingting Wei

hello!
未定义与 'double' 类型的输入参数相对应的函数 'gaussian'。

出错 TestPrecisionFindpeaskSG (line 25)
y=h(1).*gaussian(x,p(1),w(1))+h(2).*gaussian(x,p(2),w(2))+h(3).*gaussian(x,p(3),w(3))+Noise.*randn(size(x));

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!