Data returned by Audioread
6 views (last 30 days)
Show older comments
I have a question regarding the audioread function in Matlab. Audioread('file.wav') will return a normalized data of -1 to 1 that represents the amplitude of the sound. My question is, Are sensors (ex. Mica2) when acquire a sound signal and after doing the AD sampling will give me the same samples data that i'll get using Audioread?
0 Comments
Answers (1)
Star Strider
on 25 May 2017
The audioread function will read a previously-recorded audio file, so it will not itself record data from a sensor. You first have to record the data from your sensor and then play it through audioread.
See the documentation for audiorecorder (link) if you want to record sound directly from a sensor that your operating system and MATLAB support.
13 Comments
Walter Roberson
on 29 May 2017
The normalization is according to what the internal data type can hold, not according to the stored range of data.
Jan
on 29 May 2017
@Walter: Thanks. Ah, I think I get is slowly: When the signal is stored as int16, the values -32768 and 32767 are scaled to [-1, +1 - e] (with a tiny e such that 0 is still 0 inspite of the tiny asymmetry). And if the maximum value is 17, the output of audioread will be 17/32768.
This means that audioread scales the range, but not the actual signal. Then "normalized values between −1.0 and 1.0" is misleading, at least for me. I ask TMW if they could improve the help text.
See Also
Categories
Find more on Audio I/O and Waveform Generation 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!