Skip to content

Include the right edge in find_local_peaks window - #573

Open
rmz-oz wants to merge 1 commit into
MIT-LCP:mainfrom
rmz-oz:fix-find-local-peaks-window
Open

rmz-oz wants to merge 1 commit into
MIT-LCP:mainfrom
rmz-oz:fix-find-local-peaks-window

Conversation

@rmz-oz

@rmz-oz rmz-oz commented Oct 2, 2026

Copy link
Copy Markdown

Fixes #572. The window now covers radius samples on both sides like the docstring says, and the third loop that could never run is gone (#474).

test_processing.py wasn't being collected because the classes were named test_*, so I renamed them. The new test fails on main.

XQRS uses find_local_peaks for its candidates, so its output shifts a little. On MIT-BIH 100, 101, 105, 108, 119, 200, 203, 207 and 208 it finds 21 fewer of 20856 beats (sensitivity 0.9777 to 0.9766), mostly in 208, and false positives stay at 733. If you'd rather keep XQRS as it was I can look at that side too.

The slices stopped at i + radius - 1, so the sample radius positions to
the right was never compared. Use one loop over the whole signal; the
third loop was unreachable (MIT-LCP#474).

The test classes in test_processing.py were named test_*, which pytest
does not collect, so rename them to make those tests run.

Fixes MIT-LCP#572
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 this pull request may close these issues.

find_local_peaks ignores the sample at i + radius, so points on a rising slope are returned as peaks

1 participant