plot a smooth envelope for oscillation curves

29 ビュー (過去 30 日間)
ZhiH
ZhiH 2018 年 8 月 4 日
コメント済み: ZhiH 2018 年 8 月 15 日
Hello, everyone, I would like to plot a smooth envelope for a oscillation curve. It seems that the function 'envelope' in MATLAB can be used to plot a envelope curve. But I cannot obtain a smooth envelope based on this function. Would anyone help me about this envelope curve? Following is the source data. Thanks.
[up,dw]=envelope(y,100,'analytic'); figure,plot(x,[up;dw])
[up,dw]=envelope(y,100,'peak'); figure,plot(x,[y;up;dw])
This is the kind of smooth envelope curve I want to obtain.

採用された回答

Greg Dionne
Greg Dionne 2018 年 8 月 10 日
Do you have a particular selection criteria for the peaks or formula for how you would like the smoothing performed at the extremities?
I ran a spectrogram on your signal to see if there was a simple envelope to extract. It appears that there is, so maybe you could try to extract the amplitude ridges. (It seems a little bit of aliasing is in your sampled signal as well. Not sure if it's important, but have a look)
spectrogram(y,kaiser(256,40),250,[],1/mean(diff(x)),'power','yaxis')
I tried to extract a few ridges:
[sst,f] = fsst(y,1/mean(diff(x)),kaiser(256,10));
fridge = tfridge(sst,f,10,'NumRidges',6);
plot(x,fridge)
I got a reasonable hit on the fundamental, so perhaps you could attempt to extract the spectrum amplitudes along those frequencies to get a good sense of the power envelope.
  1 件のコメント
ZhiH
ZhiH 2018 年 8 月 15 日
Thanks a lot! It is really helpful.

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

その他の回答 (1 件)

ZhiH
ZhiH 2018 年 8 月 4 日
Using the powerful tool, Shape Language Modeling, proposed by John D'Errico, I still cannot obtain a smooth envelope curve.
[up,up_x,up_y] = slmengine(x,y,'env','sup','plot','off','knots',60);
[dw,dw_x,dw_y] = slmengine(x,y,'env','inf','plot','off','knots',50);
figure, plot(x,[y;up_y;dw_y]);
  1 件のコメント
ZhiH
ZhiH 2018 年 8 月 4 日
Shape Language Modeling can be found at https://ww2.mathworks.cn/matlabcentral/fileexchange/24443-slm-shape-language-modeling

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

カテゴリ

Help Center および File ExchangeSmoothing and Denoising についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by