Weird problem with "sound()" function

18 visualizaciones (últimos 30 días)
Razvan
Razvan el 21 de Mayo de 2014
Comentada: W. Owen Brimijoin el 22 de Mayo de 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 comentario
W. Owen Brimijoin
W. Owen Brimijoin el 22 de Mayo de 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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Audio I/O and Waveform Generation en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by