필터 지우기
필터 지우기

Can I Use MinPeakProminence and MinPeakDistance at the same time?

조회 수: 12 (최근 30일)
Sohel Rana
Sohel Rana 2022년 9월 27일
답변: Eric Delgado 2022년 9월 29일
Hello,
I will need to find each peak (dip) from a data point. However, some of the peaks are very close to each other and in that case, I need just one peak instead of all. So I used 'MinPeakDistance' so that I can maintain a gap between two peaks. At the same time, I also need to use the 'MinPeakDProminence'. Can I use both at the same time? I used both but it looks it did not help. Still I can see two dips (first dip locations) very close to each other. In the attached figure, I tried to detect dip instead of peak.
[vl, vlocs]=findpeaks(-y2,'MinPeakProminence',2,'MinPeakDistance',0.5);
  댓글 수: 1
Mathieu NOE
Mathieu NOE 2022년 9월 29일
hello
can you share your data ?
maybe you simply need a bit of smoothing so that you get only one global dip
if that is a valid option, try with smoothdata

댓글을 달려면 로그인하십시오.

답변 (1개)

Eric Delgado
Eric Delgado 2022년 9월 29일
Yeah, sure. It's possible. Take a look at documentation of findpeaks.
  • If you specify a location vector, x, then 'MinPeakWidth' must be expressed in terms of x.
  • If you specify a sample rate, Fs, then 'MinPeakWidth' must be expressed in units of time.
  • If you specify neither x nor Fs, then 'MinPeakWidth' must be expressed in units of samples.
% Instead of:
[vl, vlocs]=findpeaks(-y2, 'MinPeakProminence', 2, 'MinPeakDistance', 0.5);
% Do this:
[vl, vlocs]=findpeaks(-y2, x, 'MinPeakProminence', 2, 'MinPeakDistance', 0.5);

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by