How to test if stereo speakers are in phase
Recently when using headphones I noticed a slight but annoying hum on the left side. I noticed the hum was there in the speakers too but not so noticeable. So, today, I opened the amplifier and got ready to check what might be the cause of the hum.
I noticed the cable for the right hand speaker (which did not have a hum) was tied in a knot with the input cable. I tried tying the cable for the left speaker in the same knot and it got rid of the hum. Maybe some negative feedback or shielding. Who knows. That was easy enough though.
But, after assembling everything again, I was not sure if the speakers were correctly wired in phase or out of phase. Hmmmm. . . how to find out without opening the whole thing again?
I had an idea. Using CoolEdit I generated a ten second audio file which had a constant tone in the left channel and the same tone in the right channel except that it inverted twice. The right hand channel was divided into four sections. The first and third were exactly like the left channel but the second and fourth had the same signal inverted.
I thought I would be able to tell by ear when the signal sounded louder (in phase) or weaker (out of phase). In fact, I could barely tell the difference but a recorder with a VU meter could very clearly discern and, as was to be expected, the speakers were out of phase and I had to invert one of them to make things right. That might have been the end but now comes the interesting part.
I thought it migh be useful to keep that audio file for future tests so I compressed it using MPEG-L3 and saved it as WAV. But, to my surprise, the compressed file was defective. The two parts where the signals are in phase were saved correctly but in the two parts where they were opposed ther was nothing. The signal was flat zero in both channels. I tried increasing the bit rate and other thing and, although it did reproduce those parts, they were badly distorted.
Then I remembered that Besweet has many more options than CoolEdit so I switched to Besweet.
Looking in LAME´s command line modifiers I see
Probably CoolEdit and the MP3 codec it is using are using Joint Stereo mode by default but this results in problems when there is so much difference between channels.
I tried using BeSweet and forcing plain Stereo ( -m -s) and the file was compressed correctly. You can download it here. Remember, parts 1 & 3 are in phase and parts 2 & 4 are out of phase. If you hear parts 1 &3 louder then your speakers are in phase and correctly wired. If you hear parts 2 & 4 louder then your speakers are out of phase and one of them should be inverted.
Now I am reminded that, in the past, I have had problems with some songs which had problems when compressed with CoolEdit and MP3. Some parts would not sound right. When I compressed them with the old DivX audio codec they sounded right but not many people have that codec. Maybe I will try compressing them with Besweet and MP3 forcing the Stereo mode and preventing the Joint Stereo mode from being used. Maybe that will make things sound right.