Weird problem with "sound()" function

25 views (last 30 days)
Razvan
Razvan on 21 May 2014
Commented: W. Owen Brimijoin on 22 May 2014
I'll keep it short:
1) load any .wav file you wish, for example:
[x, Fs] = audioread('test.wav');
2) play it with the sound() command like this:
sound(x, Fs);
3) It works, right?! Now try this (and yes, my 'x' is a column vector, so the stereo thing below is concatenated correctly):
sound([x, -x], Fs);
BAM!!! It doesn't output any sound at all ... WHY? I have my left channel 180 degrees out of phase with respect to the right channel, but I should STILL hear something. I know they'll tend to cancel eachother if I'm precisely in-between the speakers, but that's not why I'm not hearing anything. MATLAB won't play anything in fact, on neither of the speakers :(
So .. why?
  1 Comment
W. Owen Brimijoin
W. Owen Brimijoin on 22 May 2014
This is curious. I trust you have ascertained that if you play 'x' or '-x' on its own that it's audible from only a single loudspeaker? Do this to test channel two:
sound([zeros(size(x)), -x], Fs);
If your signal actually coming out of both loudspeakers, then you've got a crosstalk problem.
2) Check that your OS level system audio isn't mixing the two channels together (i.e., that you've enabled 'mono' or some kind of cross talk cancellation in the sound preferences).
3) Your audio interconnects (the physical cables) could be damaged or not plugged in properly resulting in channel bleed that in the case of 180 out-of-phase signals would severely attenuate or eliminate the summed signal.

Sign in to comment.

Answers (0)

Categories

Find more on Audio I/O and Waveform Generation 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!