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

Optionally handle non monotonic time-series #132

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

jamieforth
Copy link
Contributor

No description provided.

@jamieforth jamieforth force-pushed the pr/handle-non-monotonic branch 5 times, most recently from 55cfe97 to cd9610e Compare January 27, 2025 00:44
@jamieforth jamieforth marked this pull request as draft January 27, 2025 09:04
@jamieforth jamieforth force-pushed the pr/handle-non-monotonic branch 2 times, most recently from d689858 to b67ef67 Compare February 2, 2025 23:18
* Refactor _jitter_removal and add _detect_breaks

* Segment when positive timestamp intervals exceed threshold (previous
  behaviour)

* Segment at negative timestamp intervals irrespective of threshold

* Add tests for _jitter_removal and _detect_breaks
* Add _detect_clock_resets to handle segmentation
Current implementation fails:
- does not return correct segment indices
- does not reliably detect negative clock resets
- does not correctly calculate MAD statistic for clock values
Passes all _detect_clock_reset tests
- fixes detecting negative clock resets
- fixes MAD statistic calculation for clock values
Current implementation passes all tests.
Current implementation fails:
- clock reset-based synchronisation does not correctly index the
  time-stamp array
* Clock reset ranges now map to correct time-stamp ranges

* Passes:
  - clock jumps forward tests
  - clock jumps backward tests

* Unhandled edge case: non-monotonic time-stamps between two clock
  offsets detected as a reset boundary could result in samples being
  allocated to the wrong clock segment. However, this would be apparent
  to the user as spurious segments detected during dejittering.
* time-stamps within an unusable clock offset region (LinAlgError) are
  not synchronized but the clock_segment is retained

* empty clock offset regions are discarded because they do not map to
  any time-stamp indices
    * New load_xdf parameter: handle_non_monotonic (default: False)
      - None: disable monotonicity checking
      - False: check and warn only if non-monotonic data are detected
      - True: attempt to sort non-monotonic data

    * Additional tests for monotonicity
@jamieforth jamieforth force-pushed the pr/handle-non-monotonic branch from b67ef67 to 909f17a Compare February 3, 2025 14:17
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.

1 participant