Smooth a graph as if placing a rope across the data…?

47 Views Asked by At

I'm not sure how to correctly phrase this question, in fact if I knew exactly what I needed to ask I could probably work it out myself, so please bear with me.

What I need to do is smooth out a line, but weight the smoothing so that the smoothed graph never goes below the sampled data. What it would look like is if you put a thick rope over the sample points so that at the pointy bits the smooth curve of the rope would be close to the data, and at the low points of the data the smooth rope would be hanging in space. Like the red line here (it's a bit wrong at the top right, but you get the idea):

enter image description here

This is for some motion graphics I'm doing. The samples are from a timed transcript of someone speaking. As they speak their words appear, and then float off, driven by an expression. If I track the timing of the words exactly it's very jerky, if I take an average of the value over a period of time, e.g. five seconds I get the smoothness I want, but it looks bad when the text lags behind the speaking, but not so much if the speech lags behind the words.

1

There are 1 best solutions below

0
On

You're possibly looking for the envelope of the data. There is a Wikipedia article on it. https://en.m.wikipedia.org/wiki/Envelope_(waves)