Training Peaks defines an interesting metric called VI (Variability Index). It is simply NP/Pwr (Normalized Power divided by Avg Power). For endurance activities (such as a 12 or 24 hour bike race), it is helpful to track VI for, say, the last "n" minutes (user defined, say 10, 20, 30 mins). Helps you track that your power generation is smooth.
So, I need to calculate NP for the last "n" minutes.
NP is another of the native Garmin metrics that isn't exposed in the CIQ API (like Grade). Bummer. So, we have to calculate it. It is easy enough for the last 30 seconds (see the 4 step process, below). It just takes computational power to regenerate NP every second using a rolling 30 second buffer of power data. And, it is easy enough to track NP since the start of the activity by maintaining a running average of the NP values generated every second.
If I wanted to know the NP for the last "n" minutes. Would it make sense to just save the overall activity's NP value once a minute, and then average the last "n" (say: 30) values? To give me the NP for the last 30 minutes?
Here is the 4 step process to calculate the current NP value.
Thanks!