Repository navigation
Stream large Intan RHD recordings to DAT files - #32
Merged
Merged
Conversation
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.
Large RHD recordings currently require allocating the full recording in MATLAB before export. Add
read_Intan_RHD2000_file('streamToDat', true)to write amplifier, auxiliary, analog input, digital input, and timestamp DAT files one RHD block at a time.The export uses sample-interleaved analog channels, raw ADC counts, auxiliary samples repeated four times, packed digital words, and integer timestamp ticks. Amplifier centering and pre-v3 software notch filtering match the in-memory reader, with filter state carried between blocks. Reject incomplete blocks before exporting, check read/write counts, report timestamp gaps, and close input/output handles on errors.
The default workspace-loading behavior remains available. Streaming overwrites these five DAT files beside the selected RHD recording; it does not export supply, temperature, digital output, or header files. Recordings containing only a header retain the existing metadata-loading behavior.
Validation: all 10 regression tests passed locally in MATLAB R2025a. Synthetic multi-block recordings cover RHD versions 1.0–3.0, multi-channel ordering and digital bits, both notch frequencies, signed/unsigned timestamps, missing channels, malformed files, output-open failures, default loading, header-only files, and picker cancellation.
git diff --checkpassed; MATLAB Code Analyzer reported only the two existing unused-variable warnings. Large real recordings were not available for validation.Format reference: Intan RHD data file formats.