findAllPeaks

버전 1.0.5 (175 KB) 작성자: Daniel
Complements find peaks function with the possibility to find all peaks, both local maximums, and local minimums.
다운로드 수: 643
업데이트 날짜: 2020/1/18

라이선스 보기

Besides complementing find peaks function with the possibility to find all peaks, both local maximums, and local minimums.
This also provides a possible workaround for the findpeaks bug pointed out by PeakProminencesBugExample.mlx file.

The output of the findAllPeaks funcition is a set of structure arrays.
Positive, negative and all peaks respectively with the following fields:
- peak
- location
- width
- prominence
- base
- isNegative
- prominenceRatio

Usage example:

x_length = 1000;
x = linspace(0,1,x_length);
PeakSig = peakSigFcn(x, x_length);

[positive, negative, all] = findAllPeaks(PeakSig,x);

figure
plot(x, PeakSig);
hold on

% Plot positive peaks in red.
plot([positive.location],[positive.peak],'v','MarkerSize',5,...
'MarkerEdgeColor','black',...
'LineStyle','none',...
'MarkerFaceColor','red')

% Plot negative peaks in green.
plot([negative.location],[negative.peak],'^','MarkerSize',5,...
'MarkerEdgeColor','black',...
'LineStyle','none',...
'MarkerFaceColor','green')

% Plot peak computed bases. Prominences fixed.
plot([all.location],[all.base],'+','MarkerSize',5,...
'MarkerEdgeColor','black',...
'LineStyle','none')

인용 양식

Daniel (2024). findAllPeaks (https://www.mathworks.com/matlabcentral/fileexchange/73943-findallpeaks), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2019b
모든 릴리스와 호환
플랫폼 호환성
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.5

Example converted to mlx file.

1.0.4

Rename PeakProminencesBugExample to PeakProminencesBug

1.0.3

Fix initial and final peaks prominence and base.

1.0.2

Add feature to allow the inclusion or not of the initial or ending function values as peaks.

1.0.1

Add example files.

1.0.0