{"action":"created","issue":{"url":"https://api.github.com/repos/csu-hmc/GaitAnalysisToolKit/issues/128","labels_url":"https://api.github.com/repos/csu-hmc/GaitAnalysisToolKit/issues/128/labels{/name}","comments_url":"https://api.github.com/repos/csu-hmc/GaitAnalysisToolKit/issues/128/comments","events_url":"https://api.github.com/repos/csu-hmc/GaitAnalysisToolKit/issues/128/events","html_url":"https://github.com/csu-hmc/GaitAnalysisToolKit/pull/128","id":64835578,"number":128,"title":"Speed up inverse dynamics (Python version)","user":{"login":"moorepants","id":276007,"avatar_url":"https://avatars.githubusercontent.com/u/276007?v=3","gravatar_id":"","url":"https://api.github.com/users/moorepants","html_url":"https://github.com/moorepants","followers_url":"https://api.github.com/users/moorepants/followers","following_url":"https://api.github.com/users/moorepants/following{/other_user}","gists_url":"https://api.github.com/users/moorepants/gists{/gist_id}","starred_url":"https://api.github.com/users/moorepants/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moorepants/subscriptions","organizations_url":"https://api.github.com/users/moorepants/orgs","repos_url":"https://api.github.com/users/moorepants/repos","events_url":"https://api.github.com/users/moorepants/events{/privacy}","received_events_url":"https://api.github.com/users/moorepants/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-03-27T19:25:38Z","updated_at":"2015-03-31T23:36:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/csu-hmc/GaitAnalysisToolKit/pulls/128","html_url":"https://github.com/csu-hmc/GaitAnalysisToolKit/pull/128","diff_url":"https://github.com/csu-hmc/GaitAnalysisToolKit/pull/128.diff","patch_url":"https://github.com/csu-hmc/GaitAnalysisToolKit/pull/128.patch"},"body":"Addresses issues #30 and some of #49.\r\n\r\nThe Octave file `leg2d.m` was quite slow. It takes from 5 to 6 minutes on my machine to compute the inverse dynamics of a 8 minute (100 Hz) chunk of data. This has bothered me a long time because it takes hours to process all of our data when it shouldn't. So I decided to finally fix it.\r\n\r\nI decided not to spend time improving the performance of the `leg2d.m` and its dependent functions because I'd rather purge the Octave stuff from this library (the octave/python bridge has too much overhead and complicates installation especially on Windows).\r\n\r\nSo I've simply ported the `leg2d.m` file to a Python function in `gait.py` and also switched to using library filters (scipy.signal) and the finite difference functions in DynamicistToolKit for speed gains. From the simple port I'm seeing close to a 1000 fold performance increase. It now takes less than a second to process 8 minutes of data.\r\n\r\n- [ ] Release new version of DTK.\r\n- [x] Address the filtering differences.\r\n- [ ] Break up `lower_extremity_2d_inverse_dynamics()` into several smaller functions or convert to a class.\r\n- [ ] Add change to the release notes.\r\n- [ ] Fix tests that fail due to the changes in butterworth in dtk."},"comment":{"url":"https://api.github.com/repos/csu-hmc/GaitAnalysisToolKit/issues/comments/88284828","html_url":"https://github.com/csu-hmc/GaitAnalysisToolKit/pull/128#issuecomment-88284828","issue_url":"https://api.github.com/repos/csu-hmc/GaitAnalysisToolKit/issues/128","id":88284828,"user":{"login":"moorepants","id":276007,"avatar_url":"https://avatars.githubusercontent.com/u/276007?v=3","gravatar_id":"","url":"https://api.github.com/users/moorepants","html_url":"https://github.com/moorepants","followers_url":"https://api.github.com/users/moorepants/followers","following_url":"https://api.github.com/users/moorepants/following{/other_user}","gists_url":"https://api.github.com/users/moorepants/gists{/gist_id}","starred_url":"https://api.github.com/users/moorepants/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moorepants/subscriptions","organizations_url":"https://api.github.com/users/moorepants/orgs","repos_url":"https://api.github.com/users/moorepants/repos","events_url":"https://api.github.com/users/moorepants/events{/privacy}","received_events_url":"https://api.github.com/users/moorepants/received_events","type":"User","site_admin":false},"created_at":"2015-03-31T23:36:59Z","updated_at":"2015-03-31T23:36:59Z","body":"Ok, I now get virtually identical results with these changes:\r\n\r\n- add in the filtfilt correction factor\r\n- differentiate markers before filtering\r\n\r\n![selection_072](https://cloud.githubusercontent.com/assets/276007/6931617/242af7dc-d7c4-11e4-8a7b-0dfb88f1e4c8.png)\r\n"}}