Audioread function and 32bit audio

24 次查看(过去 30 天)
Mike
Mike 2023-5-2
评论: Mike 2023-5-3
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.

回答(1 个)

Walter Roberson
Walter Roberson 2023-5-2
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 个评论
Walter Roberson
Walter Roberson 2023-5-2
The file format described at https://www.sounddevices.com/32-bit-float-files-explained/ is the IEEE 754 single precision floating point representation.
Mike
Mike 2023-5-3
Thank you again, Walter - that's a really helpful link. As you say, it seems like standard 32 bit .WAV files use the established IEEE standard, and hence the numerical values that can be stored occupy the full ~1500dB range above/below 0. In all practical cases, certainly involving signal sampling, I suppose we'll only be using a tiny fraction of that possible range (i.e. the region around +/-1, give or take).

请先登录,再进行评论。

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by