Here is a simple approach that works with any sequence of points.
A point has an x,y. Your y is the altitude. Your x = 0,1,2,3,4,5,... Or perhaps 'time'
The "feature" of this approach is that the resulting line is smooth and is not constrained to fit through any particular point - except start and end point.
https://www.b4x.com/android/forum/t...h-curved-line-to-a-sequence-of-points.143178/
You can also try various averaging techniques. A running average of 3 or 5 points, smooths points well depending how large outliers are.
new P(i) = [p(i-2) + p(i-1) + p(i) + p(i+1) + p(i+2)] / 5 At the boundaries just adjust that formula: p(0) = p(1)+ p(2) /2 etc.
By weighting each term, you can achieve good results, depending on the data.
Another common smoothing approach is the the use of cubic splines or Bezier curves.
If you are using this data where you have to communicate with others about your curves, you need to check the literature to see what acceptable techniques are being used for you kind of data. What methods are commonly used for smoothing altitude data? I googled and here are some suggestion, even an algorithm.