I am considering building an iPhone GPS app to assist runners. It would need to get an accurate speed reading (within 1mph) every 10 seconds. Is the iPhone 3GS or the new iPhone 4 capable of giving a reading this accurate?
Doubtful over time. Maybe for a few cycles. But between sleep, GPS lag, and accuracy issues I think it will be challenging. It's also worth asking how many people run with their iPhone?
It's possible but you couldn't depend on it 100% because of the possible inaccuracies of the gps. And your timing would need to be such that it's gaugeing on straight line distances so 10 seconds apart might work but you could also capture a point every second or two then figure the distance between all the points in that 10 second spread and use that against the starting timestamp and ending timestamp. Best option is to put something together and test it.
In terms of accuracy it's possible (as long you don't lose the signal of course). Especially since GPS is much more accurate in relative positioning (i.e. it might have 10m uncertainty in positioning you on the map, but it'll detect it if you move for 1m). For periods that there's no signal, you'll just get an average velocity or something.
However note that leaving the GPS on like this will dramatically eat up the battery so it might not be very satisfactory for your customers if used for a long period.
You might want to use other technologies or ask for the user's assistance and use the GPS less often. For example, you could sample the location every minute or so, and then use the map API to guess how the user moved from A to B (or ask the user if it's not possible).
You may be better off counting shake events as each shake will correspond to a foot-strike. Then use the GPS as a means of calibrating the runners average stride length every 10 seconds or so. Over time, you may be able to correlate frequency of foot-strikes and GPS data with the average stride length. I would expect a more tired runner to use a shorter stride and fewer foot-strikes per second.
Does the iphone have an accelerometer? You could do it that way. Also, there is a very similar app that I personally use that works very well, but it's not for iphone due to various OS limitations.
Yes, is probably the short answer. Download a similar app like Trails Lite to test it for your needs.
If you average your location samples over 10 seconds then you will end up with a pretty accurate speed reading. Think of it like the needle of a speedometer in an old car, bouncing around with every pothole. If you look at it for a split-second, then you can't tell what speed you're doing, but if you study it for 10 seconds (and I don't recommend trying this) you can get a much better idea.
As has already been pointed out, the accuracy of absolute positioning may only be accurate to 40m or so, but relative positioning is much more accurate, and that's what you need.
As some people have noted, you'll run into the problem of spots in service. This can be accounted for, though I wouldn't call it fixed, by keeping track of their average speed for the past minute/few minutes and apply that to the "gray zone."
This keeps them moving forward at what can be somewhat safely assumed as their current speed, as long as they're not stopping and starting often. This fallback number can be kept up to date and swapped for the realtime number in instances where service isn't available, and then swapped out again when service comes back. You could possibly incorporate the accelerometer to make sure they're still running when the fallback number is being shown.