0

How to convert 24bit to 32bit in Python?

I have a binary file with 24i24q, meaning 24bits for each sample.

They are big endian.

I thought about open the file and save each sample to a Numpy array.

Then taking each item from the Numpy array and convert it from 24bits to float 32bits. Then return Numpy array with each array is a pair of float32, so each item (pair of i+q) is Numpy.complex64, am I correct?

Thanks in advance.

I try to look on other sources on the internet but nothing was the same as the problem I have if I'm not wrong.

  • Do the answers to this [question](https://stackoverflow.com/questions/3783677/how-to-read-integers-from-a-file-that-are-24bit-and-little-endian-using-python) help at all? – quamrana Nov 08 '22 at 15:18
  • Question is very confusing. At first, it sounds like you just have a file of n×3 bytes, describing 24 bits integers. That you want to convert to 32bits. Then you mention floats. Are talking 24bits floats?. And then, Complex made their entry on the scene. Could you clarify. What it your input. What is your desired output. – chrslg Nov 08 '22 at 15:28

0 Answers0