필터 지우기
필터 지우기

finding accurate number of peaks and eleminate unwanted peaks

조회 수: 3 (최근 30일)
sarmad m
sarmad m 2017년 3월 20일
편집: Greg Dionne 2017년 3월 22일
HI
I'm trying to find peaks in this data :
the actual data has 10 peaks as shown in the image below (peaks are in rectangle)
. I applied sgf filter got the peaks below
order = 7;
framelen =15;
x=data;
lx = 34;
sgf = sgolayfilt(x,order,framelen);
plot(x);
hold on;
plot(sgf);
sgf=-sgf;
[pks_smoothed,locs_smoothed,widths_smoothed,proms_smoothed] = findpeaks(sgf,'MinPeakProminence',0.05);
pks_smoothed = -pks_smoothed;
plot(locs_smoothed,pks_smoothed,'g*');
text(locs_smoothed+.02,pks_smoothed,num2str((1:numel(pks_smoothed))'))
it detects many unwanted peaks how can I find the required peaks accurately and get rid of unwanted peaks ?

답변 (1개)

Greg Dionne
Greg Dionne 2017년 3월 20일
Try:
findpeaks(sgf,'MinPeakProminence',1.2);
  댓글 수: 3
Adam
Adam 2017년 3월 21일
편집: Adam 2017년 3월 21일
Well, you can just set the 'NPeaks' property to 10, but whether it picks the 10 you want or not is another matter. You may still have to tweak around with some of the other options for findpeaks.
Greg Dionne
Greg Dionne 2017년 3월 22일
편집: Greg Dionne 2017년 3월 22일
An alternative is to perhaps take the output of your widths_smoothed and prom_smoothed and come up with some heuristic that matches the most of the peaks you care about then filter out the rest based upon that somehow. Some of your peaks look kind of "flat". Maybe use a combination of medfilt1() and diff() to identify the edges.

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

카테고리

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