Audioread function and 32bit audio
24 views (last 30 days)
Show older comments
The help information for audioread ( https://uk.mathworks.com/help/matlab/ref/audioread.html ) says that 32 bit audio is read from a .WAV file into a range of -1:+1 (if it's read as a 'native' datatype), at single precision.
My question:
- Is the full-scale of IEEE single precision data being 'scaled' internally to a range of -1:+1 in some way, or is the fuction reading in all the raw IEEE single precision numbers and somehow 'zooming in' as default to show only -1:+1, since that's the range within which we would expect audio to have been scaled (however it was generated or measured)? This latter option would presumably mean that Matlab could read in samples that are greater than -1:+1, and store them without scaling, if that's what was in the WAV file.
0 Comments
Answers (1)
Walter Roberson
on 2 May 2023
If you encounter a .wav file with 32 bit single precision data, and the data is outside of the range -1:+1 then the data is out-of-specification, an invalid .wav file .
If the .wav uses a codec (not just uncompressed data) then the codec will have assumed that the data is in the correct range, and should be unable to decompress out of the range (except perhaps due to round-off error.)
I'm not saying such files will never happen... but they "shouldn't".
3 Comments
Walter Roberson
on 2 May 2023
The file format described at https://www.sounddevices.com/32-bit-float-files-explained/ is the IEEE 754 single precision floating point representation.
See Also
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!