Taking the first bit (i.e. even vs odd)

1 Ansicht (letzte 30 Tage)
Eliza am 17 Dez. 2020
Kommentiert: Eliza am 18 Dez. 2020
I need to read a binary data file with this information: 3600000 Samples, 8-Bits, Start Location: 112. I used the command '*uint8'.
But I have to take the first bit (i.e. even vs odd) to convert to binary 0-1 from each of the 1000 bytes. Then down sampling from 1000 to 200, by taking every 5th bit.
Can you help with that, please?

Akzeptierte Antwort

Ameer Hamza
Ameer Hamza am 17 Dez. 2020
Bearbeitet: Ameer Hamza am 17 Dez. 2020
Why not take the last bit of every fifth byte, to begin with. For example, something like this
f = fopen('filename.bin', 'r');
data = fread(f, inf, '*uint8');
data_5 = data(1:5:end);
bits = rem(data_5, 2);
  2 Kommentare
Eliza am 18 Dez. 2020
Thank you so much.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)


Mehr zu Large Files and Big Data finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by