Conversation
pull_chunk can return fewer than chunkSize samples, and the averaging produced a shorter data buffer while leaving the timestamps untouched. Build a matching downsampled timestamp per averaged sample so the two stay length-aligned, and drop the aliased pre-allocated downSamplingBuffer (every row referenced the same list).
The x-position was derived from a per-chunk slot counter, which assumes every chunk holds the same number of samples. pull_chunk can return variable counts, so slots drifted and produced disconnected segments. Position each sample by its own timestamp relative to the sweep origin, track the actual last-drawn x for the connecting line, and start a new sweep once a full screen of time has elapsed.
Move t0, chunk_idx, lastX, lastY, mean and scaling out of single widget attributes into a per-stream dict. Streams at the same nominal rate can arrive out of phase, so each stream must track its own sweep origin and position; switching the plotted stream now resumes that stream's own timeline instead of jumping.
A flat channel (routine with HD-EEG reference/disconnected channels) had its range padded by a tiny epsilon, yielding a ~1e12 scaling factor that overflowed drawLine's int32 coordinate as soon as the channel carried a real value. Scale a zero-range channel to 0 so it draws centered. Fixes labstreaminglayer#18, labstreaminglayer#20.
Downsampling only decimated streams above 1 kHz to ~1 kHz, a negligible saving given the canvas is far narrower than even a 1 kHz sweep, while adding real complexity and (until recently) bugs. Always emit the raw pull_chunk output and let QPainter draw it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Also fixes #18, #20, closes #21 (see 72af5be)
Updates sigvisualizer to use actual proper python packaging, updates it to support Qt 6, fixes various bugs, and also adds Qt theming because at this point why not.
It seems like this project is unmaintained atm; if you'd like to add me as an external collaborator I'd be happy to keep it up-to-date. I've got some thoughts as to some other changes I'd also like to make to improve usability, but I'm keeping this PR relatively narrowly scoped (ha) for now.