Audioread function and 32bit audio

조회 수: 7 (최근 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).

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by