[python-win32] ATT DSP32C to IEEE

Thomas Heller theller at python.net
Fri Jan 6 17:00:40 CET 2006


RayS <rays at blue-cove.com> writes:

> I'm trying to find an efficient way to convert from DSP32C binary files
> smmmmmmm mmmmmmmm mmmmmmmm eeeeeeee
> to IEEE float
> seeeeeee emmmmmmm mmmmmmmm mmmmmmmm
>
> I tried struct and bit-shifting from a C manual example, but it 
> failed. Has someone else coded this in Python? I'll post the early 
> attempt when I get into the office later, if not.
>
> I re-coded from scratch, converting each 32 bit ATT value to a binary 
> string, slice-rearranging bits, then re-packing to IEEE. A bit 
> slowwwww. At least they're small files.

You could try ctypes bitfield structures, maybe, to access the fields?

Thomas



More information about the Python-win32 mailing list