You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that cycles.detect_cycles() loops through each frame of ts.data to determine which frames exceed the defined threshold. Avoiding loops would improve efficiency, especially if users have timeseries data with a high sampling frequency or duration.
Describe the solution you'd like
Avoid loops if possible.
Describe alternatives you've considered
Here's the shameless plug for how I've approached gait cycle identification in the past... See splitsteps() in https://github.com/alcantarar/dryft/blob/master/dryft/signal.py. The core component is that you compare the entire array to the threshold, then use np.diff() to identify when the signal is crossing the threshold with a positive (events == 1) or negative (events == -1) slope.
Maybe this approach is helpful, maybe it's not. I designed it for running GRF data, with some built-in checks for cycles that were suspiciously too long/short.
Additional context
N/A
Are you able and willing to help? here is a test script that shows splitsteps() in action with real world GRF data.
The text was updated successfully, but these errors were encountered:
In fact cycles.detect_cycles() will be refactored someday (issue #35). It currently attempts to do too much: finding cycles using different threshold criteria, while at the same time ignoring glitches or bad cycles using other criteria, all this while mixing up fundamentally different concepts like rejection of a glitch vs a proper cycle that doesn't meet minimal requirements. It mostly works for now, but it should be better. I'm still not sure what is the most API for it yet.
I will be sure to check your code, thanks for your plug! I'm curious how your method would work on wheelchair propulsion, which is what I mainly do, since phase transitions based on pushrim reaction forces are much less clear cut than in gait. To be continued...
I noticed that
cycles.detect_cycles()
loops through each frame ofts.data
to determine which frames exceed the defined threshold. Avoiding loops would improve efficiency, especially if users have timeseries data with a high sampling frequency or duration.Describe the solution you'd like
Avoid loops if possible.
Describe alternatives you've considered
Here's the shameless plug for how I've approached gait cycle identification in the past... See
splitsteps()
in https://github.com/alcantarar/dryft/blob/master/dryft/signal.py. The core component is that you compare the entire array to the threshold, then usenp.diff()
to identify when the signal is crossing the threshold with a positive (events == 1) or negative (events == -1) slope.Maybe this approach is helpful, maybe it's not. I designed it for running GRF data, with some built-in checks for cycles that were suspiciously too long/short.
Additional context
N/A
Are you able and willing to help?
here is a test script that shows
splitsteps()
in action with real world GRF data.The text was updated successfully, but these errors were encountered: