Peak picking

버전 1.0.0.1 (2.42 KB) 작성자: Christos Saragiotis
Finds peaks or troughs in a vector or 2-D matrix.
다운로드 수: 2.4K
업데이트 날짜: 2023/11/23

라이선스 보기

pickpeaks
Pick peaks.
Summary
pickpeaks is similar to MATLAB's findpeaks in that it returns local peaks and their indices for the input X, but has some advantages
  • It is faster (much faster for large vectors),
  • It allows X to be a 2D matrix (not just a vector) and the user can specify across which dimension to look for peaks.
  • It gives the option to either pick peaks or troughs.
Call
The call is
[Vo, Io] = pickpeaks(X, npts, dim, mode);
Examples of usage are:
[Vo,Io] = pickpeaks(X);
[Vo,Io] = pickpeaks(X, [], [], 'troughs');
[Vo,Io] = pickpeaks(X, 10, [], 'troughs'); % require at least 10 samples distance between troughs.
[Vo,Io] = pickpeaks(X, [], 2); % search for peaks across rows
Comparison with findpeaks
pickpeaks
  • does not provide the findpeaks option 'Threshold'.
  • does not provide the findpeaks’ options: 'MinPeakHeight', 'NPeaks', 'SortStr'.
The effect of these options ('MinPeakHeight', 'NPeaks', 'SortStr') can be achieved easily by manipulating the output. E.g. if Vo, Io are the output of pickpeaks, the following will yield the same result as setting 'MinPeakHeight' to 0.5:
i = find(Vo < 0.5);
Vo(i) = [];
Io(i) = [];
The screenshot was generated by
x = randn(200,1);
tic, [val,ind] = pickpeaks(x,10); toc
tic, [pks,loc] = findpeaks(x,'minpeakdistance',10); toc
figure
plot(x); hold all;
plot(ind, val, 'ro', loc, pks, 'k+', 'MarkerSize', 10);
legend('x', 'pickpeaks', 'findpeaks');
Notice another difference between findpeaks and pickpeaks: findpeaks does not qualify some peaks (e.g. 3 peaks around sample 50) because there are other peaks in their vicinity, which did not qualify either. pickpeaks will pick those as well.

인용 양식

Christos Saragiotis (2024). Peak picking (https://www.mathworks.com/matlabcentral/fileexchange/27811-peak-picking), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2009b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Descriptive Statistics에 대해 자세히 알아보기
도움

받음: Localpeaks

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.1

Updated the FileExchange description.

1.0.0.0