What are the units of a .wav file?
9 views (last 30 days)
Show older comments
I am reading in a .wav file with audioread. I believe the units of the file are in volts. Is this correct? If so, are these volts rms? If not how can I convert to Vrms? What is the advantage of reading in the file with audioread versus using 'native' and audioread?
Thanks!
0 Comments
Answers (1)
Walter Roberson
on 28 Feb 2018
The units of a wav file are "relative fraction of maximum intensity" if you read without using the 'native' option.
With the 'native' option, the units might or might not have any physical meaning, depending on the situation.
" I believe the units of the file are in volts. Is this correct?"
NO!
"If not how can I convert to Vrms?"
Calibrate the entire system.
2 Comments
Walter Roberson
on 28 Feb 2018
The units of a wav file are "relative fraction of maximum intensity" if you read without using the 'native' option.
If you are reading with .native, then you get one of:
- Whatever the recording system felt like putting in; or
- Whatever the analog to digital convertor felt like emitting.
It is entirely possible that the A/D has a lot of little quirks about what value ranges it emits, and that the recording software knows those quirks and rewrites the data to a different range. A/D convertors are not required to be linear! There are A/D convertors that are more sensitive towards the middle with the values representing the extremes being "further apart". There are A/D convertors that are more sensitive towards the extremes with the values representing the middle being "further apart". A/D convertors might emit signed or unsigned values depending on their settings. A/D convertors set to less than 16 bits or less than 8 bits might left pad samples with 0 or might right pad samples with 0. A/D convertors in some settings do not use the full range. Some A/D convertors work in decimal rather than binary. Some A/D convertors emit differentials rather than absolute values. Some A/D convertors use the first few bits to encode how the individual sample was encoded, such as whether it is absolute or differential. Some A/D convertors embed timestamps along with the data. And the software on the system might be working with such complicated A/D and rewriting the internal A/D values... but rewriting to what ?
Calibrate. You need to calibrate.
See Also
Categories
Find more on Measurements and Spatial Audio 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!