Skip to content

Conversation

@jvmead
Copy link
Member

@jvmead jvmead commented Oct 6, 2025

Fixing a bug in the baselining:

  • np.ptp is signed and requires np.abs around it to prevent occasional large offsets in the baseline for large signals
  • dropping zeros from the list of sorted ranges prevents ADC clipping from generating a min range of 0 with offset of the full scale of the ADC as the baseline

Copy link
Member

@mjkramer mjkramer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mjkramer
Copy link
Member

Following up, new proposed change: Replace the zero ranges with nans only for the purpose of sorting. Use the true ranges (and means) everywhere else. This avoids returning nan while still achieving the original goal w.r.t. clipping. This seems to work (plots).

@jvmead
Copy link
Member Author

jvmead commented Nov 18, 2025

I cherry picked your changes from Commit 927c659 linked above and broke it

@jvmead
Copy link
Member Author

jvmead commented Nov 18, 2025

okay something weird is going on, I'll run another test locally

@jvmead jvmead mentioned this pull request Dec 8, 2025
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.

2 participants