Open tkevinbest opened 1 month ago
@tkevinbest, thanks for reporting this issue. Would you mind posting a sample data file so we can create a minimum working example?
The file is too big to upload, but I've shared it here: https://www.dropbox.com/scl/fi/7q9lcho6imbx7mbypurne/OpensimResampleTestCase.zip?rlkey=ajt3fxqzzw7w4t4ra31qq08hd&st=7x6w9uks&dl=0
Hi @nickbianco, just wanted to say that I tested the files and received two warnings in addition to the machine precision check reported by @tkevinbest:
[warning] Storage.resample: resampling at time step 0.0916798 (but minimum time step is 0.00400000).
For some reasons, a limitation has been set on data size in both resample
and resampleLinear
methods:
https://github.com/opensim-org/opensim-core/blob/897689f036a23a13b692ef3725b29a827227486b/OpenSim/Common/Storage.cpp#L118
https://github.com/opensim-org/opensim-core/blob/897689f036a23a13b692ef3725b29a827227486b/OpenSim/Common/Storage.cpp#L2525-L2528
[warning] Cutoff frequency should be less than half sample frequency. Changing the cutoff frequency to 0.49*(Sample Frequency)...cutoff = 5.34469
This is probably a consequence of the above limitation (sample frequency is changed).
Hope this helps.
When selecting "filter input coordinates" in the ID tool, my IK data gets resampled even though it was output at a fixed frequency from the IK tool. The code here says it should only resample if the sampling is not uniform: https://github.com/opensim-org/opensim-core/blob/cbf9c74c065194dd4ac2d350bbd580a09a575848/OpenSim/Common/Storage.cpp#L2370. There appears to be something wrong with the machine precision check and determining whether or not the sampling is uniform.
I know that my data was resampled because it is a very long file, beyond the max size of the resampling function and thus my sampling rate drops substantially when resampling.
Version 4.5-2024-01-10-3b63585