DSPRelated.com
Forums

Convert binary files to different bit resolution

Started by sauw...@gmail.com August 25, 2008
I've got a binary file in 24 bits that I would like to convert to 16 bits and 12..

Does anyone know if there is a simple way of doing it in matlab besides using fread(fid,inf,'bit24=>bit16') because that doesn't seem to be working..

Also tried to convert the bin file to a wav file and then decrease bit size with a program like Audacity. However, Audacity has its limits.. ie from 32 to 24 to 16.. no 12! What's up with that..

Hope you guys can help me. Thanks.
On Mon, 25 Aug 2008, s...@gmail.com wrote:

> Also tried to convert the bin file to a wav file and then decrease bit
> size with a program like Audacity. However, Audacity has its limits..
> ie from 32 to 24 to 16.. no 12! What's up with that..

There is no such thing like 12-bit WAVE. You can only clear 4 least
significant bits and save as 16-bit one.

--
Grzegorz Kraszewski
http://teleinfo.pb.edu.pl/~krashan