I am trying to measure phase difference between two received waves which are recorded by two separate PC's (microphones). The two PC's starts recording at the same time, then I make a sine wave sound with frequency of $1000\textrm{ Hz}$ using a sound speaker which is recorded by the two microphones.

For the purpose of measuring the phase difference between the two recordings, I do a cross-correlation between the two waves. Theoretically ... the distance between zero and the index of the peak value of the output graph (after cross-correlation) is the phase difference between the two waves.

For some reason I am getting a graph with more than one peak. I think this is because of the noise.

  • Does someone know if I can make a normalized cross-correlation to sound waves, does this solve my problem ?

  • If yes, how can I do this ?

  • If no, any suggestions to solve this problem ?

The waves and the correlation after plotting in MATLAB:

enter image description here

I know the two waves are not perfectly the same, they represent a sine wave with $1000\textrm{ Hz}$, which is recorded by two separate desktop PC's.

As you can see, there are 3 peaks in the cross-correlation graph. And this is just an example , some recordings gave me about 10 different peaks.

  • $\begingroup$ it will extremely helpful if you could upload those graphs of the captured waves and their cross correlation result... $\endgroup$ – Fat32 Jun 12 '16 at 20:52
  • $\begingroup$ You can see the post again, iv'e uploaded the graphs $\endgroup$ – Redan Hassoun Jun 12 '16 at 22:35
  • $\begingroup$ What happened to your sine wave sound ? It seems not like a sine wave at 1000 Hz. What is your sampling frequency? (assuming a standard PC, something like 22.050,44100,96.000 hz ?) $\endgroup$ – Fat32 Jun 12 '16 at 23:48
  • $\begingroup$ Multi-path will often distort the envelope of a sine wave in normal room acoustic environments. $\endgroup$ – hotpaw2 Jun 12 '16 at 23:49
  • 2
    $\begingroup$ @Fat32 : Depends on the size of the room and how many reflective surfaces are around, compared to the duration of the tone burst. If the room is bigger than the burst length, then the signal might never reach stationarity. $\endgroup$ – hotpaw2 Jun 12 '16 at 23:54

When using a constant tone audio beacon, beware of room echoes causing multi-path interference and distortion, especially around the leading and trailing portions of your received waveforms.

Try using a frequency sweep instead of a constant tone for your transmit waveform. This might provide you with a sharper correlation peak that is less likely to have duplicate peaks.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.