Add Limits Around Plot
显示 更早的评论
Using the data set shown in the plot below, I would like to insert a line above and below the steps in the plot by +/-0.05 and return the data points associated with these lines. Basically, I want to keep the limit lines and plot different data sets inside of these lines.
I've tried to +/- 0.05 to the data and plot, as well as, attempt to find the steps in the plot, but because of the high frequency, I wasn't able to get the result I want. Is there a way to plot the lines with a lower frequency so it just catches the big picture steps?

Zoomed in:

回答(1 个)
Star Strider
2016-6-14
0 个投票
I would use either the envelope function (also ‘abs(hilbert(signal))’) or the Savitzky-Golay filter function sgolayfilt.
To use either of those, you will probably have to do it twice, first on the signal as it currently exists, then on the negative of the signal. Use the ‘negative of the negative’ result to plot the lower boundary. You can add or subtract small offsets to get the result you want.
Everything in signal processing requires experimentation, so you will most likely have to tweak the function parameters a few times.
类别
在 帮助中心 和 File Exchange 中查找有关 Smoothing and Denoising 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!