Effacer les filtres
Effacer les filtres

Add Limits Around Plot

2 vues (au cours des 30 derniers jours)
Matthew Tourtelot
Matthew Tourtelot le 14 Juin 2016
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:

Réponses (1)

Star Strider
Star Strider le 14 Juin 2016
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.

Community Treasure Hunt

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

Start Hunting!

Translated by