fitting envelope peak points

8 ビュー (過去 30 日間)
Ancalagon8
Ancalagon8 2020 年 5 月 22 日
コメント済み: Image Analyst 2020 年 6 月 19 日
I am facing some problems trying to create a fitting curve that will pass through maximum peaks. I tried findpeaks
findpeaks(Sig)
hold all
plot(Sig,'k')
as well as envelope
[up, lo] = envelope(Sig,'peak');
plot(Sig, 'o-k');
hold on
plot(up,'r');
plot(lo,'b');
legend ('bb','up','down')
grid
How can i create a fitting curve which will pass through max peak points? Will a solution be to export peaks into a new array, plot them and then create a fitting curve or there is another way?
Thanks in advance!

採用された回答

Image Analyst
Image Analyst 2020 年 5 月 22 日
Just try interp1() or spline(). Pass in your peak points and then the x values of the whole array, something like
[peakValues, indexes] = findpeaks(Sig);
yOut = spline(indexes, peakValues, 1:length(Sig));
plot(yOut, 'b-', 'LineWidth', 2);
grid on;
Let me know if it works. Attach your Sig data if it doesn't. Accept this answer if it does.
  11 件のコメント
Ancalagon8
Ancalagon8 2020 年 6 月 18 日
@Image Analyst would it be possible to adjust the above code for power law and not exponential fitting?
Image Analyst
Image Analyst 2020 年 6 月 18 日
Yes. Did you try to change the model? It's not hard. See attached.

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

その他の回答 (1 件)

Ancalagon8
Ancalagon8 2020 年 6 月 19 日
編集済み: Ancalagon8 2020 年 6 月 19 日
@Image Analyst thank you once more for your answer!I tried to change the code so as to receive something like this but i did not work for me:
  1 件のコメント
Image Analyst
Image Analyst 2020 年 6 月 19 日
Wow, that's bizarre, but we've seen it before. See this link.
It seems to be related to the OpenGL renderer.
Or see this answer.

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

カテゴリ

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