Help me out with a simple smoothing function for accelerometer data?

I am saving the last 30 data from Input.accelerationEvents in a List to catch tilt gestures.

One problem I’m getting is that the raw data often has “stairsteps”.
two or three samples that are the same or almost the same, followed by a jump to two or three
higher or lower values that are almost the same, in the middle of an otherwise smooth slope.
for example:

... 1.35, 1.40,  1.51,  1.51, 1.67, 1.67, 1.73, 1.81, 1.89, ...

In this case, I’d want to bump the second 1.51 upward a bit and the 1.67 down a bit to give me a sequence more like

... 1.35, 1.40, 1.51, 1.56, 1.61, 1.67, 1.73, 1.81, 1.89, ...

which would be a lot more useful if I’m looking for directional trends - after smoothing
that’s an upward trend of 9, instead of three upward trends of 3, 2, and 3.

So I asked Wikipedia and I am now baffled and overwhelmed
by the amount and complexity of all the different kinds of smoothing functions there are.

Maybe ‘smoothing’ isn’t even really what I want to do, because something like this coming from the accelerometer:

... 0.23, 0.25, 0.87,  0.48, 0,41, ...

is significant- I don’t want to flatten any spikes, just cut the corners off all the stairsteps.

Not sure what language you are using but you could use Distinct from Linq to get only the unique values without the stairsteps:

   using System.Linq;

  ....

   public List<float> myInputs = new List<float>();

  ...

  var inputsToUser = myInputs.Distinct(); //Returns a list of the unique values