Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tkevinbest opened this issue Sep 30, 2024 · 3 comments · May be fixed by #3978
Open

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

tkevinbest opened this issue Sep 30, 2024 · 3 comments · May be fixed by #3978
Assignees

Comments

@tkevinbest
Copy link

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:

if(dtmin<SimTK::Eps) {
. 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
Copy link
Member

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

@tkevinbest
Copy link
Author

@mrrezaie
Copy link
Contributor

mrrezaie commented Oct 26, 2024

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:

    const int Storage::MAX_RESAMPLE_SIZE = 100000;

    // Limit aDT based on expected number of samples
    int maxSamples = MAX_RESAMPLE_SIZE;
    if((getLastTime()-getFirstTime())/aDT > maxSamples) {
    double newDT = (getLastTime()-getFirstTime())/maxSamples;

  • [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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants