Author Topic: Downsampling error  (Read 1558 times)

Feanor

  • It's mostly downhill from here.
Downsampling error
« on: 24 June, 2019, 07:47:18 pm »
Last weekend, I did a mountain hike with Mrs. F and others.
I recorded it on my Suunto watch, and Mrs F. on both a Garmin watch and a Garmin bike computer.
The watch died early, but the bike computer had been set to a power-saving mode which reduces the number of points recorded.

I did the full route which came out at 17k, which is close to the advertised 16k considering there was a bit of bumbling about going on.
Mrs F's group stopped a bit early on account of running out of time.
But her tracklog only showed 11k, which seemed too low, considering the final bit they skipped was only about 3k.

I chopped my tracklog to the same finish point, and compared the distances.
Mine was 14.3k, hers was 11k.

Plotting them both together, looking at them zoomed out, they look identical.
But mine had 15000 points, and hers only 5000.

The route was very ziggly-zaggly, but nonetheless I'm surprised by the magnitude of error caused by the downsampling.
Both seemed to capture the ziggles and zaggles to a reasonable extent at least visually.
Basically, about 3k difference over a 14k route.

frankly frankie

  • I kid you not
    • Fuchsiaphile
Re: Downsampling error
« Reply #1 on: 25 June, 2019, 09:18:59 am »
15000 points for 14.3km is more than 1 per metre.  It's difficult to envisage any real-world use for such detailed recording, except perhaps as part of a survey.  5000 points seems a more sensible density.
Assuming walking at about 4k/h, 15000 points is also more than one per second.  Some devices that log heart rate into the tracklog use a recording frequency of 1 per second, again it's hard to see any practical use for a frequency greater than that.  I imagine once per second is what was happening here - equating to an average walking speed of around 3.5k/h, sounds reasonable.

For comparison, my Etrex (at default settings) when used on the handlebars records one point per 60m approximately, at 20k/h-ish cycling speeds.  I haven't checked what the density is for walking, but extrapolating from this it's going go be around one point per 15m.  That would be 953 points for 14.3km.

When you say "the route was ziggly-zaggly" to you mean that apparently straight sections of your walking route were represented in the tracklog by a drunkard's walk - which would be normal GPS behaviour - or that the route you were following was very twisty with few straight sections?
when you're dead you're done, so let the good times roll

Feanor

  • It's mostly downhill from here.
Re: Downsampling error
« Reply #2 on: 25 June, 2019, 12:29:24 pm »
The actual route on the ground was very twisty: think steep ascent / descent paths.
So the lower sample rate cut some corners, as you would expect.

I was just surprised how big a difference it made.

FWIW, here's my track:
https://www.strava.com/activities/2471912442

and hers:
https://www.strava.com/activities/2474552238

( I needed to truncate mine to make a direct comparison )

Phil W

Re: Downsampling error
« Reply #3 on: 25 June, 2019, 01:14:42 pm »
Hmm, not sure it is a downsampling error.

I have just exported your two tracks from Strava and truncated yours approximately to match your wife's.

Her track comes up at 15.1km and your truncated version comes up at 14.3km.  So my suspicion is that the original format of the files were FIT which has a seperate record for total distance travelled. If Strava gets a FIT file it takes the figure in the distance record and not the distance calculated by plotting straight lines between all the trackpoints contained in different records.  Where as with my looking at the GPX (only) the only way to come with a total distance is to do the latter, and that comes out at 15.1km in both my GPS utility tools and Basecamp.

I bet if you download the GPX (make sure it has timing data in or reimport will fail) of your wife's track on Strava, delete the existing Strava activity and then re-import from the GPX you'll find the distance is nearer what you'd expect.