MATLAB Answers

Why does .m4a audio file (imported via audioread) get stored in workspace with two data series/data columns instead of just one?

1 view (last 30 days)
Johannes Stache
Johannes Stache on 11 Sep 2021
Commented: Rik on 12 Sep 2021
Hi all,
i imported an .m4a audio file with following command: [yh fs]=audioread('background_noise.m4a').
Looking now in my workspace my data (yh) is stored as a 46080x2 double. Now i know that 46080 are my samples (nothing special) but I am wondering why my audio data is stored in two columns with slightly different values instead of just one column? I mean it is "just" an audio file, isn't it?
Can someone please tell me why that is and what information I get out of this?
I would be super happy for a quick reply/answer!
Best regards,

Answers (1)

Stephen on 11 Sep 2021
Edited: Stephen on 11 Sep 2021
Clearly your audio file has two channels. The MATLAB documentation states that the first output is "... returned as an m-by-n matrix, where m is the number of audio samples read and n is the number of audio channels in the file."
Rik on 12 Sep 2021
Unless you have actual stereo sound, it is very possible the difference between the two signals is very close to the measurement error. It might be helpful (depending on what exactly you're looking at) to process them independently and compare the results.
Some audio setups will also just duplicate their mono sound and store it as stereo, although your setup apparently does have true stereo.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!