2
votes

Starting from this question I was made to understand how to deinterleave the left and right channel of a 16 bit PCM data.

My question now is, how will a 8 bit PCM be deinterleaved and "stretched" into a 16 bit value

1
Given interleaving of 8 bits left channel, 8 bits right channel repeated, what do you need to know about uninterleaving? If you want to "stretch" it, a crude way is to multiply by 256 (i.e. treat the byte as if it were the ms/high byte in 16 bit data with a "0" ls/low byte.) If you want to attempt some kind of smoothing - that's a huge question.Tony Delroy

1 Answers

6
votes

16-bit PCM has basically the same data bits and additional bits on the least significant bit side to specify the value and add accuracy and detail. Then 8-bit PCM is typically unsigned value with a centerpoint of 0x80, and 16-bit (also applicable to higher bitnesses) PCM is signed integer, so the conversion formula is:

UINT8 sample8 = ...;
INT16 sample16 = (INT16) (sample8 - 0x80) << 8;