Why the audioread function is giving data samples in two coloum?

Hi there I am using the code below to read sata samples in my audio dataset. Usually the size of data is (number of data samples in audio file X 1) but here I am getting (number of data samples in audio file X 2), can any one explain please?

[data,fs]=audioread('F_01_02_05.wav');
fs=44100;

Here data=112128X2 double ??

 Accepted Answer

That indicates that the audio has two channels (stereo)

7 Comments

Okay, then how to process it using matlab tool, as on python thebshaoe ibam getting is no of (samples, )
MATLAB functions such as filter() and fft() already process columns separately.
There are some functions that might require you to loop over columns.
The number of samples is size(data, 1) and the number of channels is size(data, 2)
Sir you are not getting my problem probably, I want to extract features of wav files which should be in order NX1 but here two channels gives NX2. Are you saying I need to process both the channels or single channel samples are enough?
In python there is no such problem dealing with mel spectrogram extraction, Here If i make x as x' then the problem is solved but I dnot think thats the correct way.
Regards
If you need to process single channel wav files for your purposes, but this file is not single channel, then it follows that you should not be trying to process this file.
As you mention mel histogram, that suggests to me that you are doing voice analysis.
Consider the following different situations:
  • same signal is on both channels; in this case it does not matter which one you use
  • same voice is directly received by both microphones, and no distance calculations need to be done; in this case it probably does not matter which one you use
  • same voice is received by both microphones, one by direct path and the other by reflection; in this case, the reflected version will have different phase characteristics and it might make a difference which one you use
  • environment has echos, and analysis of the difference between the channels might be necessary to reconstruct the original signal. For example, did the voice confirm adding something to an Amazon shopping list and then confirm Purchase Now, or was the second Yes an echo?
  • one channel is someone giving a UN speech in Dutch and the other channel has someone giving a simultaneous translation into German. Which of the two are you wanting to process?
Clearly there cannot be any one answer to whether to discard one of the channels or which one to discard, or whether it is a good idea to average the channels.
very ckear explanation sir, and yes m working in speech. Done this in python but for a specific model i need to run this on matlab. We have created this dataset on our ow, but all available datasets are single channel. As I said in python I did not face this problem it is tackled by python directly.
now as you said i need to observe the channel output first.
Sorry, I have no information about how audio files are read on python, or about how python treats processing multiple channels.

Sign in to comment.

More Answers (0)

Categories

Find more on Audio Plugin Creation and Hosting in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!