Hi Marlies,
Thank you for the reply and you are partially right. I overlooked the fact that, as the name suggests,
"lowpass_cutoff_frequency_for_coordinates" filters the IK result before calculation, not the ID result generate afterwards. When set to -1, OpenSim ID tool is calculating joint moments with kinematics unfiltered, whereas we only want the time unfiltered.
Therefore, I must retract my opinion in the previous comment of "one solution would be your suggestion No.1", as OpenSim is actually calculating ID with IK in the wrong time stamp so replacing the time stamp in ID is not enough. However,
I still don't think your suggestion 2 of resampling ID result is correct. Again with Gait2392 template data as an example, the filtered IK starts with 0.492s, and I'm not sure if OpenSim calculate ID with GRFs extracted from 0.492s or from 0.5s (as suggested by the original IK);
this needs to be confirmed by looking through the code.
You might think this can be checked by deleting the kinetic data before 0.5s and see if simulation still runs. Well, I did a little test by removing all data before 2.5s, and strangely OpenSim still yields ID result! So I guess the missing GRFs is filled in with zeros, and at this stage, you simply shouldn't trust the ID result if lowpass_cutoff_frequency_for_coordinates changes your time stamp.
As for filtering kinetic data, I would like to take the chance and elaborate on it. In fact, I looked into this a while back, and yes, many studies support using same filter frequency for kinematics and GRFs, but the evidence are quite weak as results are mixed. In the second paper you recommended, Derrick et al. (2020) nicely summarized the conundrum we face dealing with ID:
Several researchers have shown that a disparity in the frequency content can cause artifacts in the intersegmental moments that cannot be explained by the dynamics of the activity. This necessitates the same cutoff frequencies for kinetic and kinematic data filtering. However, this
poses a problem with impact forces that can be attenuated by low-pass cutoff frequencies that are in the range necessary to reduce noise in the kinematic data. Decisions concerning the cutoff frequency need to be made based on the purpose of the experiment and the variables being measured.
Basically, the selection of cut-off frequency should be
case-specifc, and in my own experience, the same frequency is a bad chocie. I got interested in this question using the dataset from Camargo et al. (2021) [1]. When I filter the GRFs before ID either with 6 Hz (same as kinematic filter) or 10 Hz (commonly used value), I get an unrealistically high dorsiflexion moment in the beginning of a gait cycle; 6 Hz yields much worse result than 10 Hz.
One way to get reasonably-looking result is to calculate ID with the GRFs in a high frequency (15 Hz), and then filter the joint moment values with 6Hz afterwards; this is what Camargo did in his code to obtain the figures in his paper. I'm not sure why this happened, but it is one example of not choosing the same cut-off frequency. In fact, this high-prefilter + low-postfilter is a new way of signal processing in ID, and could be worthwhile of investigation.
Back to our original problem, I would go for pre-filtering IK myself and then feed it to ID with lowpass_cutoff_frequency_for_coordinates set to -1 (whether to prefilter the GRFs or postfilter the moments should be case-specific). This way you can be sure that the time stamp of kinematics and GRFs matches for OpenSim to calculate a reliable ID.
But the best solution is to have this time-filter problem directly solved in OpenSim I would've debugged it myself if I had the time to look through the code, but I will at least issue it in GitHub so they can fix in the next version.
[1] Camargo, J., Ramanathan, A., Flanagan, W., & Young, A. (2021). A comprehensive, open-source dataset of lower limb biomechanics in multiple conditions of stairs, ramps, and level-ground ambulation and transitions. Journal of Biomechanics, 119, 110320.
https://doi.org/10.1016/j.jbiomech.2021.110320