MATLAB Answers

Translated by

このページのコンテンツは英語から自動翻訳されています。自動翻訳をオフにする場合は「<a class="turn_off_mt" href="#">ここ</a>」をクリックしてください。

Matlaber
0

What is the meaning of "width" and "prominences" in findpeaks

Matlaber
さんによって質問されました 2019 年 2 月 7 日
最新アクティビティ Star Strider
さんによって コメントされました 2019 年 2 月 7 日
It said that:
[pks,locs,w,p] = findpeaks(data) additionally returns the widths of the peaks as the vector w and the prominences of the peaks as the vector p.
w is the widths of the peaks as the vector w
I still unable to find out how they calculate the width.
In the example below:
x = linspace(0,1,1000);
Pos = [1 2 3 5 7 8]/10;
Hgt = [4 4 2 2 2 3];
Wdt = [3 8 4 3 4 6]/100;
for n = 1:length(Pos)
Gauss(n,:) = Hgt(n)*exp(-((x - Pos(n))/Wdt(n)).^2);
end
PeakSig = sum(Gauss);
Plot the individual curves and their sum
plot(x,Gauss,'--',x,PeakSig)
grid
findpeaks(PeakSig,x,'MinPeakProminence',2,'Annotate','extents','WidthReference','halfheight')
[pks,locs,w,p]= findpeaks(PeakSig,x,'MinPeakProminence', 2,'Annotate','extents','WidthReference','halfheight')
title('Signal Peak Widths')
w =
0.2352 0.1725
p =
4.8721 3.0028
Is the w is the width (half-height) and p is height as pointed in the plot?

  0 件のコメント

サインイン to comment.

タグ

1 件の回答

回答者: Star Strider
2019 年 2 月 7 日
 採用された回答

Is the w is the width (half-height) and p is height as pointed in the plot?
Your interpretation of ‘p’ is correct. The value of ‘w’ returned depends on how you define 'WidthReference' (link). You can define it to be full width half maximum (FWHM) if you define it as 'halfheight'.

  2 件のコメント

Matlaber
2019 年 2 月 7 日
Thanks! I didn't see the documentation in details.
I had tried:
findpeaks(PeakSig,x,'MinPeakProminence',2,'Annotate','extents','WidthReference','halfprom')
[pks,locs,w,p]= findpeaks(PeakSig,x,'MinPeakProminence', 2,'Annotate','extents','WidthReference','halfprom')
title('Signal Peak Widths')
4.jpg
w =
0.2351 0.1724
p =
4.8721 3.0028
(The W is almost the same, different by 0.0001)
W = width (half-prominence for 'halfprom' default)
W = width (half-height for 'halfheight')
Star Strider
2019 年 2 月 7 日
My pleasure.
It is quite possible that ‘prominence’ and ‘height’ are essentially the same in some situations.

サインイン to comment.



Translated by