# How to find the time instant where my sent signal and received signal can synchronize?

I am having two .wav files, one is modulated wave that is made into a .wav file and another is a recieved .wav file which is recorded from microphone while playing first modulated .wav file. So now that I have two .wav files, one sent and one received. I am trying to synchronize the two files so that I can find the exact time instant where my received file gets in sync with sent file.

I am using, received_wave = thinkdsp.read_wave(filename = '.wav') to read the wave from file and modulated_wave.write(filename = '.wav') to write the wave into file. I am using Think DSP module in python for doing these.

So this received_wave and modulated_wave has two attributes ys and ts where ys is amplitude and ts is time stamps. I want to find the ts such that both wave will synchronize.

for this right now iam using crosscorrealtion of modulated wave(with sync bits) and recieved wave(having both sync bits and data that iam sending such a way that start sync bits then data bits then again end sync bits) so when i crosscorrelate start sync modulated wave(modulated wave using start sync bits only)and recieved wave i can find the value in crosscorrelation matrix where it is almost equal to the auto correlation of sync_wave.

is this approach correct? or shud i check for maximum value of crosscorrelated matrix then find the index ?

• Note that, unless you play and record on the same computer, the clock difference between transmitter and receiver make perfect synchronization impossible. What the transmitter considers to be one second is different from what the receiver does. This means that one of the signals will be stretched compared to the other. – MBaz Jun 6 '16 at 13:04
• Can you please mark clearly the part of your question that was edited after the answer was provided? SE does not work like a forum. The short answer to your (additional) question is yes, that's the "alternative" way of aligning the signals. – A_A Jun 6 '16 at 21:21
• its the last two paragraphs i have edited, but that method is not giving me best syncronized index. – Sate Jun 7 '16 at 9:26