Average moving speed

Hey,
As far as I understood, an average speed displaying in the activity takes into account elapsed time, but not moving. I guess it would be great if an average moving speed is also displayed.

The values on top of the activity page are Moving Time, Moving Speed, Moving Pace.
When you make selections on the graphs, you will see elapsed time and avg speed (including zeroes) if they are configured in the Fields.

1 Like

The average speed (with zeroes) is displayed on the top. It isn’t avg moving speedScreenshot_33

It is the moving speed calculated by intervals.icu. Just make a selection of the complete activity and check the avg speed… It will be lower if there are parts were you stopped.
This isn’t necessarily the same number as Garmin calculates because different suites use different thresholds for moving/not moving. On your recording device you probably have a setting for the speed at which it will pause. That is what is used by Garmin. Intervals has its own threshold and in your case the intervals threshold is lower then what’s configured on Garmin
You need this sort of threshold because otherwise everything will be moving time. The reason is the GPS location instability.
And surely, threshold speed will be different for running/cycling.
It’s one of those numbers that will never match in between different apps just like elevation.

1 Like

How can I use moving speed in script?

I’d like to bump this one. The above assertion that it is based on moving speed looks incorrect:

Safari 2025-04-17 at 11.26.22

using total time:
38.18 / 125.8166 * 60 = 18.2 km/h

using moving time:
38.18 / 118.52 * 60 = 19.32 km/h

In addition, the thresholds for ā€œstoppedā€ state are not lenient enough in my opinion. It would be amazing if there was some way to adjust this, or even just have better defaults. ie ignore anything below n km/h (using apple watch gps, there are quite regularly non-zero values that are < 1 km/h, for example. i have auto-pause disabled to correctly track recovery periods).

Thanks for the consideration!

I wonder if something changed…
For Run/Walk it still is as I said, avg speed/pace in the summary is based on moving time. Selections are based on total time. Double checked just now.
But when I check for rides, I do see the same as you. It is based on total time. To be honest, I’m now unsure if this has always been like that for rides or if it changed somewhere recently. @david ?

This could be the average of the speed stream. Which is sometimes way different then the calculation of distance divided by moving time.

Therefore I created my own custom field ā€˜Avg. Speed’:
IMG_1681

It calculates distance / moving_time

I’ve edited the summary layout and using the custom field instead of the default value.

1 Like

The average speed for rides displayed in the summary matches exactly the distance/elapsed time calculation.
For some reason, I was (wrongfully) persuaded that it displayed avg speed based on moving time like it does for Runs.

1 Like

Very cool, didn’t know you could do that!

Unfortunately, living in a city, even with this equation the base moving time is still noisy with ā€œstoppedā€ time to the point it’s not so useful (an average of 2-3 stops per kilometre adds up quickly >_<), so I’d hope to have a more advanced method of filtering low values.

No, it doesn’t. In my example it was 6h28m elapsed time and 158km. That would be 158/6,5=24,3 km/h. But the default field shows 25.9 (the bottom value), my calculation shows 26.1 (distance/moving_time):
IMG_1681

Now I’m completely lost :flushed:

1 Like

@MedTechCD I am not 100% sure, but now I think you are partly correct. I think it uses something like ā€œrecorded timeā€ (= elapsed - not recorded time). So if you do never ever press pause, it is distance/elapsed_time. That is also true for most of my rides, regardless of stops at signs etc.
But for long rides I usually press the pause button for longer breaks, so it is not anymore elapsed time. If I subtract the pause time, these calculations would match my assumption. But it’s just a guess.

@Dean_Herbert What would be your idea of ā€œbetterā€ calculation of moving time? Do you use GPS only or speed sensor?

Now that I know you can make custom scripts, here’s my proposal (public as ā€œAverage speed adjustedā€):

distance = streams.get("distance").data
time = streams.get("time").data

minimum_speed = (1 * 1000) / 3600

total_distance = 0
time_moving = 0

for (let i = 1; i < time.length; i++) {
  dDelta = distance[i] - distance[i - 1]
  tDelta = time[i] - time[i - 1]
  if (dDelta >= minimum_speed)
  { 
    time_moving += tDelta
    total_distance += dDelta
  }
}

total_distance / 1000 / (time_moving / 3600)

With a test ride (flat, only slowdowns were traffic light stops):

base icu value: 23.8 km/h
@R2Tom’s version: 24.7 km/h
this version: 26.1 km/h

Here’s how the average look against the effort:

It’s subjective at the end of the day, but seems closer to expectations. For this same ride, ridewithgps shows 27.3 km/h. With an adjusted minimum speed of 8 km/h (instead of the 1 km/h above) we can also get 27.2 km/h here, which looks more like this:

1 Like