0
$\begingroup$

The documentation for AudioData says:

"By default, AudioData[audio] normalizes values to lie between -1 and 1."

One might imagine that the min and max of the result would be -1 and 1 respectively but this doesn't seem to be the case.

Any suggestions as to the default normalization applied by AudioData?

$\endgroup$
  • $\begingroup$ I don't know what that line refers to, but I do not think AudioData changes the data in any way. It simply extracts it from the Audio object, unmodified. $\endgroup$ – Szabolcs Oct 10 '17 at 20:18
  • $\begingroup$ I suggest asking Wolfram Support (and reporting back here). $\endgroup$ – Szabolcs Oct 10 '17 at 20:28
  • $\begingroup$ "Normalize" is an imprecise term in the documentation. AudioData scales the domain of values to lie between -1 and 1. A weak, quiet sound stays low volume. AudioData does not normalize individual values in the normal sound-processing meaning of the word. That's what AudioNormalize does. $\endgroup$ – creidhne Oct 12 '17 at 2:35
  • $\begingroup$ When I import a wav file (without modifiers) the RawArray in the Audio object is SignedInteger16 which what one would expect. In a case at hand, the minimum value is -21390 and the maximum value is 19783. When I apply AudioData to the object (without modifiers) I get a minimum value of -0.652771 and a maximum value of 0.603748 so it would seem that AudioData is transforming the individual values and furthermore that the transformation is not an obvious (at least to me) linear map from (-65535, 65535) to (-1,1). $\endgroup$ – Scott Guthery Oct 12 '17 at 14:47
2
$\begingroup$

AudioData normalizes the data it returns from any of the "SignedInteger" data types since the meaningful range is different depending on the data type.

It will return data from real-typed Audio objects untouched as Szabolcs commented.

To see the difference:

    list = RandomInteger[{-2^7, 2^7 - 1}, 5];
    intAud = Audio[list, "SignedInteger8"];
    relAud = Audio[list, "Real"];

    AudioData[intAud]
    AudioData[relAud]

will return:

    {{-0.445313, -0.132813, -0.0390625, -0.507813, 0.88189}}
    {{-57., -17., -5., -65., 112.}}

respectively.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.