opensim-org / opensim-core

SimTK OpenSim C++ libraries and command-line applications, and Java/Python wrapping.
https://opensim.stanford.edu
Apache License 2.0
786 stars 318 forks source link

IIR filter triggers a resample even if file is uniformly sampled #3919

Open tkevinbest opened 2 weeks ago

tkevinbest commented 2 weeks ago

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

nickbianco commented 2 days ago

@tkevinbest, thanks for reporting this issue. Would you mind posting a sample data file so we can create a minimum working example?