-
Notifications
You must be signed in to change notification settings - Fork 11
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
unpack() function deals 1-bit data differently with ewanbarr/sigpyproc #26
Comments
It is unclear if this is a bug or a convention. The implementation in the original sigpyproc was a direct port of the implementation in sigproc (see https://github.com/SixByNine/sigproc/blob/master/src/readchunk.c). There the 1-bit unpacker explicitly unpacks in little-endian order. /* unpack the sample(s) if necessary */
switch (nbits) {
case 1:
fread(&c,1,1,input);
for (i=0;i<8;i++) {
f[i]=c&1;
c>>=1;
}
ns=8;
break; The sigproc documentation states:
The endianness of the data depends on the recording instrument and it should probably be more explicitly set when reading the files. |
This is a convention so that we have the same bitorder for low-bit data. Looks like this need not be true. So, the I think using endianness as a parameter flag ( FilReader.read_block(), FilReader.read_plan(), Header.prep_outfile() Ideally, it should have been a header flag. Need to reverse/make changes in telegraphic/numbits#6 and telegraphic/numbits#7 |
As a note, the previous discussion about
|
Hi,
I found that this repository unpacks 1-bit data in big endian order, however ewanbarr/sigpyproc reacts differently in this case:
https://github.com/ewanbarr/sigpyproc/blob/54a804200723d30601026be5bfa37ec90c8266c1/c_src/libSigPyProc.c#L23-L27
I wonder if this is meant to be?
The text was updated successfully, but these errors were encountered: