Skip to content

Conversation

bemoody
Copy link
Collaborator

@bemoody bemoody commented Aug 27, 2021

If the header file does not specify the signal length, rdrecord tries to determine it based on the length of the first signal file.

This calculation was wrong when the signal file contained a prolog, or any signal contained multiple samples per frame.

Benjamin Moody added 4 commits August 17, 2021 11:05
If the header file does not specify the record length, it must be inferred from the size of the signal file (dividing the data length by the number of samples per frame.) Previously, this calculation assumed that tsamps_per_frame == n_sig, which is not necessarily the case. Correctly calculate the total spf for the first signal file and use that as the divisor, rather than the number of signals. Rename the "n_sig" parameter of _infer_sig_len to tsamps_per_frame accordingly.
If the header file does not specify the signal length, rdrecord should calculate it from the size of the signal file. Test that this works correctly for multi-frequency records.
If the header file does not specify the record length, it must be inferred from the size of the signal file (dividing the data length by the number of samples per frame.) Previously, this calculation assumed that the file did not contain a prolog. Correctly calculate the data length by subtracting the prolog length (byte offset) from the size of the file.
If the header file does not specify the signal length, rdrecord should calculate it from the size of the signal file. Test that this works correctly for a signal file with a prolog.
@tompollard
Copy link
Member

Thanks @bemoody, looks good to me.

@tompollard tompollard merged commit ae67d09 into master Sep 10, 2021
@tompollard tompollard deleted the infer-length branch September 10, 2021 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants