Resampling when filtering

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Charles Khazoom
Posts: 14
Joined: Sat Mar 10, 2018 2:07 pm

Resampling when filtering

Post by Charles Khazoom » Mon Apr 13, 2020 8:13 am

HI,

I am trying to run an inverse dynamics (ID) analysis from CMC kinematic data and ground reaction forces for a data set of about 1 s. When I run an ID without filtering the kinematics, the ID runs in a reasonable time without resampling, but a lot of noise apears in the computed torques due to differentiation. Thus, I need to filter the data.

When I filter at ~10 Hz, the ID tool resamples the data at a ridiculously small time step and thus the ID takes forever to run. I get the following warning related to the resampling. How can I disable this resampling ?

Code: Select all

Storage.resample: WARNING: resampling at time step 2.119e-005 (but minimum time step is 1.067e-005)
I also get these other comments. Are these normal or can they be avoided ? It take a long time before the ID actually starts.

Code: Select all

ExternalForce::Right_GRF
Data source being set to external_loads_sim.mot
ExternalForce::Left_GRF
Data source being set to external_loads_sim.mot
ExternalForce::pelvis_force
Data source being set to external_loads_sim.mot
Storage: file=C:\Users\Charles Khazoom\Desktop\reprocessed_simulations\subject07\trial01_v2\test_600Nvert\cmc\results\cmc_Kinematics_q.sto (nr=1328 nc=40)
ExternalForce::Right_GRF_transformedP
Data source being set to external_loads_sim.mot_transformedP
ExternalForce::Left_GRF_transformedP
Data source being set to external_loads_sim.mot_transformedP
ExternalLoads: WARNING ExternalForce 'pelvis_force' is not expressed in ground and will not be transformed.
InverseDynamicsTool: 49982 time frames in 43.679s
Thank you for your help !

Charles

User avatar
Charles Khazoom
Posts: 14
Joined: Sat Mar 10, 2018 2:07 pm

Re: Resampling when filtering

Post by Charles Khazoom » Tue Apr 14, 2020 4:35 pm

Hi, does anybody has some insight about the resampling issue ?

Thanks,

Charles

User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: Resampling when filtering

Post by Christopher Dembia » Wed Apr 15, 2020 9:10 am

The warning
ExternalLoads: WARNING ExternalForce 'pelvis_force' is not expressed in ground and will not be transformed.
may be relevant. Do you intend to apply an external force to the pelvis?

Here is where the time step warning is generated:
https://github.com/opensim-org/opensim- ... 2610-L2614

Perhaps your motion is very long? What's the duration of your motion?

What if you try different filtering frequencies?

User avatar
Charles Khazoom
Posts: 14
Joined: Sat Mar 10, 2018 2:07 pm

Re: Resampling when filtering

Post by Charles Khazoom » Wed Apr 15, 2020 10:35 am

Hi,

Yes, I intend to apply a vertial force on the pelvis (see my other post on the forum, for which your insight would also be very valuable : viewtopicPhpbb.php?f=91&t=11773&p=0&sta ... 5aabeca824 )

I tried with 6, 10 12 Hz, but this did not solve the issue. The duration is only slightly larger than 1 second. I tried for 0.1 s, but this did not solve the issue either. Also, when I don't filter, the resampling issue does not occur, but the torques are obviously noisy even if I use somewhat smooth cmc kinematics (coordinates).

Yes, I am applying a vertical force (expressed in ground) on the pelvis COM. The .xml external loads file looks like this :

Image

User avatar
Yanran Jiang
Posts: 10
Joined: Sun Feb 09, 2020 11:48 pm

Re: Resampling when filtering

Post by Yanran Jiang » Sat Sep 26, 2020 7:10 am

Hi,

I encountered the same problem. How do you solve it at the end?

Thanks,
Yanran

POST REPLY