I assume you don't know which cable that goes which speaker. On my car the wires was marked with labels which is good. Otherwise, there is a trick with a normal battery you can use. Use the battery with the cables you want to investigate. When you close the circuit over the battery you will hear a click each time you open and close the circuit. That way you can find you which wire that belongs to each speaker. This method does not give the polarity of the wire though. You can test that with unplugging one of the wires at the speaker but it requires more job.
BMW 518g touring (e34) -96.