>Is there some clever way to achieve the same goal for 24bit data without
>copying everything into a new 32-bit array?
I agree with the other post, Int8 x 3 can be used with slices to get a lot done, depending on data tasks desired, but not all
>The typical 24bit audio file contains two interleaved channels, i.e.
>frames of 3bytes+3bytes, so it can be cast to (nframes,3) Int32, or
>(nframes,2,3) Int8 array, but this is hardly a useful representation for
Along these liners, I have been working with 24 bit ADC data returned from pyUSB as tuples, which I need to convert to Float32 and save, like this:
WRAP = 2.**23
BITS24 = 2.**24
chValue = struct.unpack(">I",
chValue = 0
chValue = ((BITS24-chValue) / WRAP) * gainFactors[thisCh]
chValue = (-chValue / WRAP) * gainFactors[thisCh]
which is really slow (no real time is possible).
Is there a much faster way evident to others here?
We are going to do a pyd in C otherwise...