Save data as 32 Bit WAVE File

16 views (last 30 days)
Sanket
Sanket on 31 Jan 2014
Answered: Walter Roberson on 31 Jan 2014
Hello,
I have vector of floating point numbers that I want to save as 16 bit and 32 bit wave file using wavwrite. The max and min in the floating numbers vectors is within the boundary that 16 bits can represent. Hence, there is no clipping for 16 bit number.
Before I write the vector as wav file, I normalize and scale them to +-1 range. After this I save them as 16 and 32 bit respectively. Later, I read both the files in Adobe Audition and it reads the amplitude of 16 bit file appropriately and scales the 32 bit down. The shape of the 32 bit and 16 bit waveform looks exactly the same, only scaling differences are observed. The difference is not small.
In the help section of wavwrite, its commented that 32 and 16 bits are saved as different representation. My guess is the problem lies here. Can someone help me try to fix this?
Thanks

Answers (1)

Walter Roberson
Walter Roberson on 31 Jan 2014
If you wavwrite() of floating point data and you specify N as 32, then the data will be saved in single precision float format. Every other combination of parameters results in the data being saved in integer format. I am not sure you are taking into account that integer vs single precision difference?

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!