Skip to content

resample_ann can get stuck under some certain conditions #116

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

Closed
wfel opened this issue Apr 10, 2018 · 1 comment · Fixed by #210
Closed

resample_ann can get stuck under some certain conditions #116

wfel opened this issue Apr 10, 2018 · 1 comment · Fixed by #210
Assignees
Labels

Comments

@wfel
Copy link
Contributor

wfel commented Apr 10, 2018

Using record 223 and the annotation file generated by ecgpuwave with

ecgpuwave -r 223 -a pqrst -i atr

the resample_multichan can get stucked

rec = wfdb.io.rdrecord('223')
ann = wfdb.io.rdann('223', 'pqrst')
wfdb.processing.resample_multichan(rec.p_signal, ann, rec.fs, fs_target=250)

due to resample_ann.

Here are the files:
https://drive.google.com/file/d/1IWQ0ijl2c20hkDUOdHWPpgjqxoOsdcKG/view?usp=sharing

@Lucas-Mc Lucas-Mc self-assigned this May 7, 2020
@Lucas-Mc Lucas-Mc added the bug label May 7, 2020
Lucas-Mc added a commit that referenced this issue May 7, 2020
Fixes the freezing seen in resample_ann when the fs_target is set too high. This causes the algorithm to develop an infinite loop which must be exited upon discovery. This pull request breaks the loop if this situation is detected. Fixes #162.
@Lucas-Mc
Copy link
Contributor

Lucas-Mc commented May 7, 2020

I just made a pull request #210 to fix this issue. It appears like the algorithm used in resample_ann was developing an infinite loop. After some investigation, I think this is caused by setting the fs_target too high as seen by the following chart which displays the fs_target on the x-axis and the number of infinite loops on the y-axis:
Infinite_Breaks
The code you posted here works now after these changes. Thanks for posting it here!

Lucas-Mc added a commit that referenced this issue May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants