Weird problem with "sound()" function

조회 수: 19 (최근 30일)
Razvan
Razvan 2014년 5월 21일
댓글: W. Owen Brimijoin 2014년 5월 22일
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
W. Owen Brimijoin
W. Owen Brimijoin 2014년 5월 22일
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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by