calculate FWHM and area of multiple peak

11 ビュー (過去 30 日間)
Namira
Namira 2018 年 7 月 28 日
コメント済み: Star Strider 2018 年 7 月 29 日
Hi, I have a graph that contains multiple peaks, I want to calculate the area of the peak and FWHM of each peak. I want to use the formula, Area = Height * FWHM.
In Matlab is there any default function to calculate FWHM and area. The curves are magnitude diagrams in the log scale. If I plot in linear scale the power of peak is near to zero. When I use the function to find peaks
[pks,locs,widths,proms] = findpeaks(x,y);
it gives 1×0 empty double row vector. Is it right way to calculate area from log scale graph? Any suggestions from anyone. Thank in advance.

採用された回答

Star Strider
Star Strider 2018 年 7 月 28 日
‘... it gives 1×0 empty double row vector.’
That is most likely because the dependent variable vector (is this ‘y’ in your code?) must be the first argument to findpeaks (link).
Try this instead:
[pks,locs,widths,proms] = findpeaks(y,x);
or preferably, just return the indices of the peaks in the ‘locs’ output with:
[pks,locs,widths,proms] = findpeaks(y);
I find the indices easier to work with.
  2 件のコメント
Namira
Namira 2018 年 7 月 29 日
Thanks.
Star Strider
Star Strider 2018 年 7 月 29 日
As always, my pleasure.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by