This question already has an answer here:

I have a plot generated from an ugly and complex set of piece-wise functions. I'm looking to extract the envelope function from this data set. I've tried a lot of suggestions in other threads, but none seem to contain information about dealing with piece-wise functions. I've tried using a Fourier series, but that didn't seem to give me what I was looking for. The plot is located belowenter image description here


marked as duplicate by corey979, Anton Antonov, LCarvalho, Henrik Schumacher, José Antonio Díaz Navas Nov 19 '18 at 17:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    $\begingroup$ Can you provide the actual data? $\endgroup$ – user6014 Nov 11 '18 at 18:30
  • $\begingroup$ Try a MaxFilter with a window about 2 or 3 units wide to extract the upper envelope. MinFilter will get the lower envelope, though from the look of your graph, this may not be interesting. $\endgroup$ – bill s Nov 12 '18 at 4:56