Search code examples
matlabaudioimportwavnormalize

Matlab .wav normalization


I'm currently working in a project where I record sound using sound meter and then export the resulting files in .wav format.

After that, I import the .wav files into MATLAB using audioread function. I realized that the data is normalized between -1 and 1 (default option). This means that each different file is normalized using their respective extreme values ? If that is true how can I get non-normalized data from .wav file, so I can compare the spectrum of two different files in terms of amplitude? What I need is exactly a file having amplitude (in dB,volts,whatever...) as function of time.


Solution

  • If you want to compare two files that have different bit-depths then the best thing to do is to allow matlab to normalize the audio.

    A 0 dBFS sine wave will have a max peak of 32767 in 16-bit signed and a 127 in 8-bit signed, for example. With the normalization they will both be converted to +1.0 (1.0 = 0 dBFS). Without normalization just think about what the two signals would look like in the time domain. The 8-bit signal would tiny in comparison to the 16-bit. In fact, it would be 8-bits or 48dB down!