How is TotalAscent calculated?

I've been playing with some exported data from an activity. If I go through every point and calculate my own "total ascent" for the activity, it is much different than what is reported in the Activity.Info object, and different than what is shown in Garmin Connect when I look at the activity later. (GC matches what Activity.Info shows, as expected.)

Here's what I'm doing to calculate my own "total ascent". Start with TotalAscent = 0. For each data point, compare the current altitude with the previous point's altitude. If the altitude increased, add the difference to TotalAscent.

I'm wondering if there is some "smoothing" going on, which is why my numbers don't match what is shown on the watch.

Any ideas? Thanks!!

- Mark
  • What watch do you have? If it doesn't have a baro, or if for some reason "elevation correction" is turned on for your activity in GC, it will be different than what's on the watch (it's corrected) GPS elevation can be off at times, which is why the correction is applied.

    There's a baro on the va-hr, 920, I think the Epix, and the f3 (including the HR, Chronos, D2, etc)
  • I personally have an Epix (and a FR 920XT, but I don't use it much). I've also seen the same thing on the Fenix 3. I think there's definitely some smoothing happening - and maybe it's different for each device. I found a couple threads discussing differences between the Edge 850 and Edge 1000 - and one of the differences seems to be the smoothing/hysteresis factor.

    I just added code to my datafield to do the same (non-smoothed) totalascent calculation that I did in Excel. I also had it auto-lap every 1 mile to break up the data a little bit. Here's the results:

    lap #, ascent (garmin), ascent (non-smoothed)
    1, 470 ft, 463 ft
    2, 257 ft, 356 ft
    3, 163 ft, 227 ft
    4, 218 ft, 268 ft

    Elevation correct is disabled in Garmin Connect, so that's definitely not the case. Plus, the smoothed values I'm getting in the Activity.Info object match what GC displays anyway.

    More than anything, I'm just curious how the smoothing algorithm works - so that I know if it's being overly aggressive for the types of activities I do. And so I can explain to users why the total ascent shown might not match what they see in other programs if they're exporting their data and analyzing it elsewhere.

    Thanks!

    - Mark
  • Former Member
    Former Member
    Garmin definitly uses a smoothing algorithm. Some weeks ago I wrote about this topic in a different forum:
    http://forums.watchuseek.com/f233/ambit-3-peak-fusialti-questions-clarifications-3728258-2.html#post35243346

    Perhaps that can help you.
  • Thanks! I've done some more reading, and I think I have an idea for a relatively simple smoothing algorithm, than can be tunable via a property/setting.

    Looking at each Activity.Info.altitude value as it comes in, I'll compare it to the previous value. If the altitude increased, I'll add it to CurrentClimb.

    Once CurrentClimb exceeds a threshold (hysteresis) value, I'll add it to TotalAscent, and keep adding increases in altitude as long as the altitude is going up.

    Once the altitutde decreases, I set CurrentClimb to zero.

    Looking at my data from the Epix, it seems like a value of 0.5 meters would be enough of a threshold to eliminate the small fluctuations that are happening. That device has a barometric altitude sensor, though. For devices relying solely on GPS data for altitude, I think a much larger threshold value would be required.